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

Commit a0f53af

Browse files
author
Zdziszek
authored
Handle DNSNotImplementedError in SRV resolver (#15523)
Signed-off-by: Zdzichu <[email protected]>
1 parent ad141ef commit a0f53af

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

changelog.d/15523.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Don't fail on federation over TOR where SRV queries are not supported. Contributed by Zdzichu.

synapse/http/federation/srv_resolver.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
from twisted.internet.error import ConnectError
2424
from twisted.names import client, dns
25-
from twisted.names.error import DNSNameError, DomainError
25+
from twisted.names.error import DNSNameError, DNSNotImplementedError, DomainError
2626

2727
from synapse.logging.context import make_deferred_yieldable
2828

@@ -145,6 +145,9 @@ async def resolve_service(self, service_name: bytes) -> List[Server]:
145145
# TODO: cache this. We can get the SOA out of the exception, and use
146146
# the negative-TTL value.
147147
return []
148+
except DNSNotImplementedError:
149+
# For .onion homeservers this is unavailable, just fallback to host:8448
150+
return []
148151
except DomainError as e:
149152
# We failed to resolve the name (other than a NameError)
150153
# Try something in the cache, else rereaise

0 commit comments

Comments
 (0)