From 4f914820927b2da13f65cfcd0ba27fdf4b7cd0ce Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Wed, 19 Jun 2024 11:00:08 +0100 Subject: [PATCH] More logging --- synapse/app/_base.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/synapse/app/_base.py b/synapse/app/_base.py index 395ec3efd7..850c63955f 100644 --- a/synapse/app/_base.py +++ b/synapse/app/_base.py @@ -532,7 +532,13 @@ async def start(hs: "HomeServer") -> None: # numbers of DNS requests don't starve out other users of the threadpool. resolver_threadpool = ThreadPool(name="gai_resolver") resolver_threadpool.start() - reactor.addSystemEventTrigger("during", "shutdown", resolver_threadpool.stop) + + def stop_threadpool() -> None: + logger.warning("Stopping thread pool...") + resolver_threadpool.stop() + logger.warning("Stopped thread pool") + + reactor.addSystemEventTrigger("during", "shutdown", stop_threadpool) reactor.installNameResolver( GAIResolver(reactor, getThreadPool=lambda: resolver_threadpool) )