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

Commit 8027166

Browse files
committed
Add a comment about _LimitedHostnameResolver
1 parent d2ac767 commit 8027166

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

synapse/app/_base.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,13 @@ def install_dns_limiter(reactor, max_dns_requests_in_flight=100):
334334
This is to workaround https://twistedmatrix.com/trac/ticket/9620, where we
335335
can run out of file descriptors and infinite loop if we attempt to do too
336336
many DNS queries at once
337+
338+
XXX: I'm confused by this. reactor.nameResolver does not use twisted.names unless
339+
you explicitly install twisted.names as the resolver; rather it uses a GAIResolver
340+
backed by the reactor's default threadpool (which is limited to 10 threads). So
341+
(a) I don't understand why twisted ticket 9620 is relevant, and (b) I don't
342+
understand why we would run out of FDs if we did too many lookups at once.
343+
-- richvdh 2020/08/29
337344
"""
338345
new_resolver = _LimitedHostnameResolver(
339346
reactor.nameResolver, max_dns_requests_in_flight

0 commit comments

Comments
 (0)