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

SRV request logging #9305

Merged
merged 8 commits into from
Feb 3, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/9305.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add debug logging for SRV lookups. Contributed by @Bubu.
7 changes: 7 additions & 0 deletions synapse/http/federation/matrix_federation_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,12 +323,19 @@ async def _resolve_server(self) -> List[Server]:
if port or _is_ip_literal(host):
return [Server(host, port or 8448)]

logger.debug("Looking up SRV record for %s", host.decode())
Bubu marked this conversation as resolved.
Show resolved Hide resolved
server_list = await self._srv_resolver.resolve_service(b"_matrix._tcp." + host)

if server_list:
logger.debug(
"Got %s from SRV lookup for %s",
", ".join(map(str, server_list)),
host.decode(),
)
return server_list

# No SRV records, so we fallback to host and 8448
logger.debug("No SRV records for %s", host.decode())
return [Server(host, 8448)]


Expand Down