discordjs / discord.js

A powerful JavaScript library for interacting with the Discord API
https://discord.js.org
Apache License 2.0
25.36k stars 3.97k forks source link

dead ffmpeg farm after client reconnect #3770

Closed Roki100 closed 3 years ago

Roki100 commented 4 years ago

Please describe the problem you are having in as much detail as possible: if using d.js internal music modules, everything works fine but after client gets disconnected from discord and gets reconnected, ffmpeg processes are not being despawned but these take 0% cpu, are attached to no dispatcher/connection (from what i found) and just taking memory causing the bot to be huge memory leak ^ thats what i think and my tests points at

Include a reproducible code sample here, if possible:


i dont think thats code-related

Further details:

Deivu commented 4 years ago

I assume this has something to do with re-indentifies as resumed sessions don't disconnect on going voice sessions.

amishshah commented 4 years ago

@Roki100 out of curiosity, are you able to replicate this on master?

Roki100 commented 4 years ago

edit: i have to end my master bot to test it out on prod

Roki100 commented 4 years ago

okay so after doing a really long tests on v12 it seems the issue still occur for me

amishshah commented 3 years ago

Hi there,

We're working on a new implementation of Discord's Voice API that has better playback quality and is more reliable than what we currently support in Discord.js v12 - check it out at https://github.com/discordjs/voice!

The new library solves many of the issues that users are facing, and as part of this, we're dropping built-in support for voice in our next major release. We have a PR (https://github.com/discordjs/discord.js/pull/5402) that adds native support for our new voice library - once this PR is merged, this issue will be closed.

You can still use our new voice library before that PR lands - just take a look at our music bot example to see how to get started upgrading your voice code. By using the boilerplate music player in the example, you can make it even easier to upgrade your code.

Note that the PR above only reduces some of the boilerplate code you'd otherwise have to write - you do not have to wait for the PR to be merged to start using the new voice library.


If you have any questions about this, feel free to: