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

Fix exception when failing to get remote room list #10414

Merged
merged 3 commits into from
Jul 20, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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/10414.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a number of logged errors caused by remote servers being down.
6 changes: 5 additions & 1 deletion synapse/handlers/room_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,13 @@ async def get_remote_public_room_list(
Codes.UNRECOGNIZED,
Codes.NOT_FOUND,
):
# Not an error that should trigger a fallback.
logger.debug("Falling back to locally-filtered /publicRooms")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this right? The comment says the error shouldn't trigger a fallback but the following log line says it's triggering a fallback.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put this comment in the wrong place...

else:
raise # Not an error that should trigger a fallback.
# Not an error that should trigger a fallback.
raise SynapseError(502, "Failed to fetch room list")
except RequestSendFailed:
raise SynapseError(502, "Failed to fetch room list")

# if we reach this point, then we fall back to the situation where
# we currently don't support searching across federation, so we have
Expand Down