Skip to content

Commit 4e06a50

Browse files
committed
Onyl clear logcontext if spans should finish
1 parent 70d0fd3 commit 4e06a50

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

synapse/logging/scopecontextmanager.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ def close(self) -> None:
155155
if self._finish_on_close:
156156
self.span.finish()
157157

158-
self.logcontext.scope = None
158+
# The tracing scope/span should stick to the logcontext if it's active
159+
# so we only clear if we're finishing the span.
160+
self.logcontext.scope = None
159161

160162
if self._enter_logcontext:
161163
self.logcontext.__exit__(None, None, None)

0 commit comments

Comments
 (0)