From 699471f27a5895c3b1684ce07f9fba21372c5c67 Mon Sep 17 00:00:00 2001 From: Kowlin <10947836+Kowlin@users.noreply.github.com> Date: Sun, 4 Aug 2024 21:28:17 +0200 Subject: [PATCH] Forcefully shutdown RPC to prevent hangs (#6412) --- redbot/core/_rpc.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/redbot/core/_rpc.py b/redbot/core/_rpc.py index 28515687a1d..5512dbbbd13 100644 --- a/redbot/core/_rpc.py +++ b/redbot/core/_rpc.py @@ -93,7 +93,14 @@ async def initialize(self, port: int): self._started, _discard, self._site = ( True, await self._runner.setup(), - web.TCPSite(self._runner, host="127.0.0.1", port=port, shutdown_timeout=0), + web.TCPSite( + self._runner, + host="127.0.0.1", + port=port, + shutdown_timeout=120 + # Give the RPC server 2 minutes to finish up, else slap it! + # Seems like a reasonable time. See Red#6391 + ), ) except Exception as exc: log.exception("RPC setup failure", exc_info=exc)