Forcefully shutdown RPC to prevent hangs (#6412)

This commit is contained in:
Kowlin 2024-08-04 21:28:17 +02:00 committed by GitHub
parent 2c2080df12
commit 699471f27a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -93,7 +93,14 @@ class RPC:
self._started, _discard, self._site = ( self._started, _discard, self._site = (
True, True,
await self._runner.setup(), 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: except Exception as exc:
log.exception("RPC setup failure", exc_info=exc) log.exception("RPC setup failure", exc_info=exc)