summary refs log tree commit diff
path: root/synapse/storage/database.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2021-04-21 16:16:10 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2021-04-21 16:16:10 +0100
commitc7cd7b45456237ac9a493d5a43c50845ac3792e0 (patch)
tree63b02c3a5573c2206248dd49d124eabee56dbeaa /synapse/storage/database.py
parentMerge commit '2fe0fb21f' into anoa/dinsic_release_1_31_0 (diff)
parentMerge tag 'v1.25.0rc1' into develop (diff)
downloadsynapse-c7cd7b45456237ac9a493d5a43c50845ac3792e0.tar.xz
Merge commit '0312266ee' into anoa/dinsic_release_1_31_0
Diffstat (limited to 'synapse/storage/database.py')
-rw-r--r--synapse/storage/database.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/synapse/storage/database.py b/synapse/storage/database.py

index d1b5760c2c..b70ca3087b 100644 --- a/synapse/storage/database.py +++ b/synapse/storage/database.py
@@ -42,7 +42,6 @@ from synapse.api.errors import StoreError from synapse.config.database import DatabaseConnectionConfig from synapse.logging.context import ( LoggingContext, - LoggingContextOrSentinel, current_context, make_deferred_yieldable, ) @@ -671,12 +670,15 @@ class DatabasePool: Returns: The result of func """ - parent_context = current_context() # type: Optional[LoggingContextOrSentinel] - if not parent_context: + curr_context = current_context() + if not curr_context: logger.warning( "Starting db connection from sentinel context: metrics will be lost" ) parent_context = None + else: + assert isinstance(curr_context, LoggingContext) + parent_context = curr_context start_time = monotonic_time()