summary refs log tree commit diff
path: root/synapse/storage/events.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2018-07-24 11:11:27 +0100
committerGitHub <noreply@github.com>2018-07-24 11:11:27 +0100
commit69292de6ccd294c224956de36f2bf424edd6e91a (patch)
tree2fbe0f15fe17c27664a6c4a7e0058e286bd6ed56 /synapse/storage/events.py
parentMerge pull request #3555 from matrix-org/erikj/client_apis_move (diff)
parentMerge branch 'develop' into rav/logcontext_fixes (diff)
downloadsynapse-69292de6ccd294c224956de36f2bf424edd6e91a.tar.xz
Merge pull request #3591 from matrix-org/rav/logcontext_fixes
Logcontext fixes
Diffstat (limited to 'synapse/storage/events.py')
-rw-r--r--synapse/storage/events.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/storage/events.py b/synapse/storage/events.py
index 392935cacf..4d0706f23d 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: