Skip to content
Snippets Groups Projects
Unverified Commit 10a08ab8 authored by Patrick Cloke's avatar Patrick Cloke Committed by GitHub
Browse files

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".
parent fa6679e7
No related branches found
No related tags found
No related merge requests found
Fix a bug introduced in v1.32.0 where the associated connection was improperly logged for SQL logging statements.
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment