summary refs log tree commit diff
path: root/synapse/federation
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2017-10-27 10:01:23 +0100
committerGitHub <noreply@github.com>2017-10-27 10:01:23 +0100
commit2fd9831f7cefaf772ef3748466ad93621930bfb2 (patch)
treec9397675334ac172f6312b67f76faae9312cea0f /synapse/federation
parentspell out need for libxml2 for lxml to work (diff)
parentUpdate room_list.py (diff)
downloadsynapse-2fd9831f7cefaf772ef3748466ad93621930bfb2.tar.xz
Merge pull request #2574 from matrix-org/erikj/room_list_fixes
Add logging and fix log contexts for publicRooms
Diffstat (limited to 'synapse/federation')
-rw-r--r--synapse/federation/federation_server.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/synapse/federation/federation_server.py b/synapse/federation/federation_server.py
index e15228e70b..a2327f24b6 100644
--- a/synapse/federation/federation_server.py
+++ b/synapse/federation/federation_server.py
@@ -18,6 +18,7 @@ from .federation_base import FederationBase
 from .units import Transaction, Edu
 
 from synapse.util import async
+from synapse.util.logcontext import make_deferred_yieldable, preserve_fn
 from synapse.util.logutils import log_function
 from synapse.util.caches.response_cache import ResponseCache
 from synapse.events import FrozenEvent
@@ -253,12 +254,13 @@ class FederationServer(FederationBase):
         result = self._state_resp_cache.get((room_id, event_id))
         if not result:
             with (yield self._server_linearizer.queue((origin, room_id))):
-                resp = yield self._state_resp_cache.set(
+                d = self._state_resp_cache.set(
                     (room_id, event_id),
-                    self._on_context_state_request_compute(room_id, event_id)
+                    preserve_fn(self._on_context_state_request_compute)(room_id, event_id)
                 )
+                resp = yield make_deferred_yieldable(d)
         else:
-            resp = yield result
+            resp = yield make_deferred_yieldable(result)
 
         defer.returnValue((200, resp))