Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Move to top
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed Oct 26, 2021
1 parent 9659440 commit d502181
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions synapse/app/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,14 @@ async def start(hs: "HomeServer"):
"""
reactor = hs.get_reactor()

# We want to use a separate thread pool for the resolver so that large
# numbers of DNS requests don't starve out other users of the threadpool.
resolver_threadpool = ThreadPool(name="gai_resolver")
resolver_threadpool.start()
reactor.installNameResolver(
GAIResolver(reactor, getThreadPool=lambda: resolver_threadpool)
)

# Set up the SIGHUP machinery.
if hasattr(signal, "SIGHUP"):

Expand Down Expand Up @@ -374,14 +382,6 @@ def run_sighup(*args, **kwargs):
# Start the tracer
synapse.logging.opentracing.init_tracer(hs) # type: ignore[attr-defined] # noqa

# We want to use a separate thread pool for the resolver so that large
# numbers of DNS requests don't starve out other users of the threadpool.
resolver_threadpool = ThreadPool(name="gai_resolver")
resolver_threadpool.start()
reactor.installNameResolver(
GAIResolver(reactor, getThreadPool=lambda: resolver_threadpool)
)

# Instantiate the modules so they can register their web resources to the module API
# before we start the listeners.
module_api = hs.get_module_api()
Expand Down

0 comments on commit d502181

Please sign in to comment.