diff options
author | Richard van der Hoff <richard@matrix.org> | 2018-07-24 00:37:17 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2018-07-24 00:37:17 +0100 |
commit | 8dff6e0322718ec9c446465c1e10ab331a417b8a (patch) | |
tree | 65a9cce97966f34bf1423d5f53c2512ac70a13d4 /synapse/storage/events.py | |
parent | Merge pull request #3584 from matrix-org/erikj/use_cached (diff) | |
download | synapse-8dff6e0322718ec9c446465c1e10ab331a417b8a.tar.xz |
Logcontext fixes
Fix some random logcontext leaks.
Diffstat (limited to 'synapse/storage/events.py')
-rw-r--r-- | synapse/storage/events.py | 5 |
1 files changed, 3 insertions, 2 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: |