summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2018-07-24 00:37:17 +0100
committerRichard van der Hoff <richard@matrix.org>2018-07-24 00:37:17 +0100
commit8dff6e0322718ec9c446465c1e10ab331a417b8a (patch)
tree65a9cce97966f34bf1423d5f53c2512ac70a13d4 /synapse/storage
parentMerge pull request #3584 from matrix-org/erikj/use_cached (diff)
downloadsynapse-8dff6e0322718ec9c446465c1e10ab331a417b8a.tar.xz
Logcontext fixes
Fix some random logcontext leaks.
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/events.py5
-rw-r--r--synapse/storage/pusher.py2
2 files changed, 4 insertions, 3 deletions
diff --git a/synapse/storage/events.py b/synapse/storage/events.py
index c2910094d0..c06dbb3768 100644
--- a/synapse/storage/events.py
+++ b/synapse/storage/events.py
@@ -39,7 +39,7 @@ from synapse.types import RoomStreamToken, get_domain_from_id
 from synapse.util.async import ObservableDeferred
 from synapse.util.caches.descriptors import cached, cachedInlineCallbacks
 from synapse.util.frozenutils import frozendict_json_encoder
-from synapse.util.logcontext import make_deferred_yieldable
+from synapse.util.logcontext import PreserveLoggingContext, make_deferred_yieldable
 from synapse.util.logutils import log_function
 from synapse.util.metrics import Measure
 
@@ -147,7 +147,8 @@ class _EventPeristenceQueue(object):
                     # callbacks on the deferred.
                     try:
                         ret = yield per_item_callback(item)
-                        item.deferred.callback(ret)
+                        with PreserveLoggingContext():
+                            item.deferred.callback(ret)
                     except Exception:
                         item.deferred.errback()
             finally:
diff --git a/synapse/storage/pusher.py b/synapse/storage/pusher.py
index cc273a57b2..8443bd4c1b 100644
--- a/synapse/storage/pusher.py
+++ b/synapse/storage/pusher.py
@@ -233,7 +233,7 @@ class PusherStore(PusherWorkerStore):
             )
 
             if newly_inserted:
-                self.runInteraction(
+                yield self.runInteraction(
                     "add_pusher",
                     self._invalidate_cache_and_stream,
                     self.get_if_user_has_pusher, (user_id,)