From 1b63ccd8483e99aa7ea72b91f99f4cd94ded2e36 Mon Sep 17 00:00:00 2001 From: "Olivier Wilkinson (reivilibre)" Date: Wed, 14 Aug 2019 14:05:50 +0100 Subject: Wrap `get_local_public_room_list` call in `maybeDeferred` because it is cached and so does not always return a `Deferred`. `await` does not silently pass-through non-Deferreds like `yield` used to. Signed-off-by: Olivier Wilkinson (reivilibre) --- synapse/federation/transport/server.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/synapse/federation/transport/server.py b/synapse/federation/transport/server.py index ea4e1b6d0f..9a86bd0263 100644 --- a/synapse/federation/transport/server.py +++ b/synapse/federation/transport/server.py @@ -19,6 +19,8 @@ import functools import logging import re +from twisted.internet.defer import maybeDeferred + import synapse import synapse.logging.opentracing as opentracing from synapse.api.errors import Codes, FederationDeniedError, SynapseError @@ -745,8 +747,12 @@ class PublicRoomList(BaseFederationServlet): else: network_tuple = ThirdPartyInstanceID(None, None) - data = await self.handler.get_local_public_room_list( - limit, since_token, network_tuple=network_tuple, from_federation=True + data = await maybeDeferred( + self.handler.get_local_public_room_list, + limit, + since_token, + network_tuple=network_tuple, + from_federation=True, ) return 200, data -- cgit 1.4.1 From 3ad24ab3865ab0e52bab7cbb7bb50f10c3cab7d8 Mon Sep 17 00:00:00 2001 From: "Olivier Wilkinson (reivilibre)" Date: Wed, 14 Aug 2019 14:09:31 +0100 Subject: Newsfile Signed-off-by: Olivier Wilkinson (reivilibre) --- changelog.d/5851.bugfix | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelog.d/5851.bugfix diff --git a/changelog.d/5851.bugfix b/changelog.d/5851.bugfix new file mode 100644 index 0000000000..6da40e6e38 --- /dev/null +++ b/changelog.d/5851.bugfix @@ -0,0 +1,2 @@ +Fixes 500 Internal Server Error on `publicRooms` when the public room list was +cached. \ No newline at end of file -- cgit 1.4.1 From d6de55bce967e89c7f8ffdbbe04ba655f969845c Mon Sep 17 00:00:00 2001 From: reivilibre <38398653+reivilibre@users.noreply.github.com> Date: Wed, 14 Aug 2019 14:48:18 +0100 Subject: Update changelog.d/5851.bugfix Use imperative Co-Authored-By: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> --- changelog.d/5851.bugfix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/changelog.d/5851.bugfix b/changelog.d/5851.bugfix index 6da40e6e38..58f7c0c1b8 100644 --- a/changelog.d/5851.bugfix +++ b/changelog.d/5851.bugfix @@ -1,2 +1,2 @@ -Fixes 500 Internal Server Error on `publicRooms` when the public room list was -cached. \ No newline at end of file +Fix 500 Internal Server Error on `publicRooms` when the public room list was +cached. -- cgit 1.4.1