forked from MirrorHub/synapse
Shut down the DNS threadpool (#11190)
The DNS threadpool must be explicitly stopped, otherwise Synapse will hang indefinitely when asked to shut down.
This commit is contained in:
parent
72626b78ef
commit
f3a4be8700
1
changelog.d/11190.bugfix
Normal file
1
changelog.d/11190.bugfix
Normal file
|
@ -0,0 +1 @@
|
|||
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)
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue