Cog-Creators / Red-DiscordBot

A multi-function Discord bot
https://docs.discord.red
GNU General Public License v3.0
4.76k stars 2.3k forks source link

RPC server shutdown hangs the bot shutdown process #6391

Closed yamikaitou closed 2 months ago

yamikaitou commented 3 months ago

What Red version are you using?

3.5.9

What were you trying to do?

Shutdown the bot

What did you expect to happen?

For the bot to shut down

What actually happened?

The shutdown process will hang during await self._runner.cleanup() if there is an active RPC connection

How can we reproduce this error?

  1. Have RPC enabled
  2. Have AAA3A's Dashboard cog running (I suspect the same will happen with any other service talking via RPC)
  3. Restart or Shutdown the bot
  4. Bot will hang during the process and continue to hang until the Dashboard's web service is restarted

Anything else?

So a possible workaround is to set the shutdown_timeout on Line 96 to be something other than 0 so the connections get forcibly closed if they don't gracefully close. Or, we can push the issue back to @AAA3A-AAA3A to see if something on his web service side is causing the connection to remain always open. Looks to be possibly related to #4134