From abc43476de68130631f3d3a04a8ce128a9ea2de6 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 16 Jul 2021 14:33:50 +0100 Subject: [PATCH 1/3] Fix exception when failing to get remote room list --- synapse/handlers/room_list.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/synapse/handlers/room_list.py b/synapse/handlers/room_list.py index c6bfa5451f37..c4698cf5d132 100644 --- a/synapse/handlers/room_list.py +++ b/synapse/handlers/room_list.py @@ -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") 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 From ee6639ed09c24b472aef808be39cb9709a7578c1 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 16 Jul 2021 14:36:44 +0100 Subject: [PATCH 2/3] Newsfile --- changelog.d/10414.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/10414.bugfix diff --git a/changelog.d/10414.bugfix b/changelog.d/10414.bugfix new file mode 100644 index 000000000000..bfebed8d29df --- /dev/null +++ b/changelog.d/10414.bugfix @@ -0,0 +1 @@ +Fix a number of logged errors caused by remote servers being down. From f9f7ff359cfb6d5c6386d25c9e04d6b87f55c014 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Tue, 20 Jul 2021 11:32:13 +0100 Subject: [PATCH 3/3] Move comment to correct place --- synapse/handlers/room_list.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synapse/handlers/room_list.py b/synapse/handlers/room_list.py index c4698cf5d132..355491cc3e24 100644 --- a/synapse/handlers/room_list.py +++ b/synapse/handlers/room_list.py @@ -381,12 +381,12 @@ 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") else: # Not an error that should trigger a fallback. raise SynapseError(502, "Failed to fetch room list") except RequestSendFailed: + # Not an error that should trigger a fallback. raise SynapseError(502, "Failed to fetch room list") # if we reach this point, then we fall back to the situation where