More logging

This commit is contained in:
Erik Johnston 2024-06-19 11:00:08 +01:00
parent 9e46ea43f4
commit 4f91482092

View file

@ -532,7 +532,13 @@ async def start(hs: "HomeServer") -> None:
# numbers of DNS requests don't starve out other users of the threadpool. # numbers of DNS requests don't starve out other users of the threadpool.
resolver_threadpool = ThreadPool(name="gai_resolver") resolver_threadpool = ThreadPool(name="gai_resolver")
resolver_threadpool.start() 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( reactor.installNameResolver(
GAIResolver(reactor, getThreadPool=lambda: resolver_threadpool) GAIResolver(reactor, getThreadPool=lambda: resolver_threadpool)
) )