question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Max CPU usage after disconnecting from voice

See original GitHub issue

It 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:closed
  • Created 7 years ago
  • Comments:16 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
appellationcommented, Dec 26, 2016

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 with SIGKILL solves the problem, but it does seem to be a bit harsh.

0reactions
appellationcommented, Mar 14, 2017

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found