Skip to content
Snippets Groups Projects
Unverified Commit f3a4be87 authored by Sean Quah's avatar Sean Quah Committed by GitHub
Browse files

Shut down the DNS threadpool (#11190)

The DNS threadpool must be explicitly stopped, otherwise Synapse will
hang indefinitely when asked to shut down.
parent 72626b78
No related branches found
No related tags found
No related merge requests found
Fix a performance regression introduced in 1.44.0 which could cause client requests to time out when making large numbers of outbound requests.
......@@ -346,6 +346,7 @@ async def start(hs: "HomeServer"):
# 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)
reactor.installNameResolver(
GAIResolver(reactor, getThreadPool=lambda: resolver_threadpool)
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment