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

Commit b0f4119

Browse files
authored
Add debug logging to DNS SRV requests. (#9305)
1 parent 3f534d3 commit b0f4119

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

changelog.d/9305.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add debug logging for SRV lookups. Contributed by @Bubu.

synapse/http/federation/matrix_federation_agent.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,12 +323,19 @@ async def _resolve_server(self) -> List[Server]:
323323
if port or _is_ip_literal(host):
324324
return [Server(host, port or 8448)]
325325

326+
logger.debug("Looking up SRV record for %s", host.decode(errors="replace"))
326327
server_list = await self._srv_resolver.resolve_service(b"_matrix._tcp." + host)
327328

328329
if server_list:
330+
logger.debug(
331+
"Got %s from SRV lookup for %s",
332+
", ".join(map(str, server_list)),
333+
host.decode(errors="replace"),
334+
)
329335
return server_list
330336

331337
# No SRV records, so we fallback to host and 8448
338+
logger.debug("No SRV records for %s", host.decode(errors="replace"))
332339
return [Server(host, 8448)]
333340

334341

0 commit comments

Comments
 (0)