Max CPU usage after disconnecting from voice
See original GitHub issueIt doesn’t happen all the time, but occasionally CPU usage will jump to max after calling <StreamDispatcher>.end()
and <VoiceConnection>.disconnect()
; it does not decline until the bot has been restarted. I experimented with having a delay between ending the dispatcher and disconnecting from the channel, but that didn’t seem to have much impact; while sometimes it would last longer before the CPU spike, the CPU would still eventually spike.
This issue is only in indev (I’ve reverted to master without a problem), and I’m unsure about where it could be since there hasn’t been a huge re-working of voice.
Issue Analytics
- State:
- Created 7 years ago
- Comments:16 (10 by maintainers)
Top Results From Across the Web
[FIXED] Windows 10 Audio Service Causing High CPU Usage ...
Hello. I updated my Windows 10 today to the 1803 build, and it seems that drivers weren't fully installed since it says in...
Read more >Constant Device disconnecting sound on high CPU load
To Disable USB sounds: Right click speaker icon in lower right hand corner-click System sound events-click Sounds tab-Scroll down to Device Disconnect-At the ......
Read more >High CPU usage kernel_task with 2 monitors - Apple Developer
The following should fix the high kernel_task CPU usage: Disconnect both external monitors. Shut down the Mac. Plug in the MagSafe power adapter...
Read more >High CPU usage by wireplumber with paused streams and ...
Disconnect the sync. Ensure default output sync is HDMI output. It is annoying that these steps are performed by the system when screen...
Read more >100% CPU Usage and How to Fix It 🖥️ - YouTube
In this video, I will show you what to do if the CPU in your computer is at 100 % usage all the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Terminating the FFMPEG process in https://github.com/hydrabolt/discord.js/blob/indev/src/client/voice/pcm/FfmpegConverterEngine.js#L35 with
SIGKILL
seems to resolve this problem (as well as a secondary problem with extra FFMPEG processes cluttering memory).This raises the question of whether this solution is indicative of a problem somewhere else. Clearly, in some cases, FFMPEG is not correctly responding to the
SIGTERM
signal. I have not investigated into why this might be the case, nor what the proper solution to this might be. Obviously terminating the process withSIGKILL
solves the problem, but it does seem to be a bit harsh.I’ve also been seeing this on master again, but since I don’t have any idea of what’s causing it, I haven’t brought it up again.