From cdeb6050ea1a3b08c850a730098edc6cc176ee70 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Wed, 5 May 2021 10:25:54 +0100 Subject: Log contexts --- synapse/crypto/keyring.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/synapse/crypto/keyring.py b/synapse/crypto/keyring.py index 03d6664a87..984a4be54d 100644 --- a/synapse/crypto/keyring.py +++ b/synapse/crypto/keyring.py @@ -43,7 +43,11 @@ from synapse.api.errors import ( from synapse.config.key import TrustedKeyServer from synapse.events import EventBase from synapse.events.utils import prune_event_dict -from synapse.logging.context import make_deferred_yieldable, run_in_background +from synapse.logging.context import ( + PreserveLoggingContext, + make_deferred_yieldable, + run_in_background, +) from synapse.metrics.background_process_metrics import run_as_background_process from synapse.storage.keys import FetchKeyResult from synapse.types import JsonDict @@ -158,7 +162,8 @@ class _Queue: results = await self.process_items(values) for value, deferred in next_values: - deferred.callback(results.get(value.server_name, {})) + with PreserveLoggingContext(): + deferred.callback(results.get(value.server_name, {})) except Exception as e: for _, deferred in next_values: -- cgit 1.4.1