diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2021-04-28 07:44:52 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-28 07:44:52 -0400 |
commit | 10a08ab88ad423bfca86983808c47f34a601ec9c (patch) | |
tree | 8ed066068952504cb3b3dd2c5c556baca88ac244 /synapse/storage/database.py | |
parent | Merge tag 'v1.33.0rc1' into develop (diff) | |
download | synapse-10a08ab88ad423bfca86983808c47f34a601ec9c.tar.xz |
Use the parent's logging context name for runWithConnection. (#9895)
This fixes a regression where the logging context for runWithConnection was reported as runWithConnection instead of the connection name, e.g. "POST-XYZ".
Diffstat (limited to 'synapse/storage/database.py')
-rw-r--r-- | synapse/storage/database.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/storage/database.py b/synapse/storage/database.py index bd39c095af..a761ad603b 100644 --- a/synapse/storage/database.py +++ b/synapse/storage/database.py @@ -715,7 +715,9 @@ class DatabasePool: # pool). assert not self.engine.in_transaction(conn) - with LoggingContext("runWithConnection", parent_context) as context: + with LoggingContext( + str(curr_context), parent_context=parent_context + ) as context: sched_duration_sec = monotonic_time() - start_time sql_scheduling_timer.observe(sched_duration_sec) context.add_database_scheduled(sched_duration_sec) |