From b77d49f4410ceb42880af2882e70b3b3164955cc Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Tue, 13 Sep 2022 16:29:51 -0500 Subject: Hopefully fix problem when OTEL not installed with non recording span ``` Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/synapse/http/server.py", line 306, in _async_render_wrapper callback_return = await self._async_render(request) File "/usr/local/lib/python3.9/site-packages/synapse/http/server.py", line 512, in _async_render callback_return = await raw_callback_return File "/usr/local/lib/python3.9/site-packages/synapse/federation/transport/server/_base.py", line 357, in new_func remote_parent_span = create_non_recording_span() File "/usr/local/lib/python3.9/site-packages/synapse/logging/tracing.py", line 502, in create_non_recording_span return opentelemetry.trace.NonRecordingSpan( AttributeError: 'NoneType' object has no attribute 'trace' ``` --- synapse/metrics/background_process_metrics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'synapse/metrics/background_process_metrics.py') diff --git a/synapse/metrics/background_process_metrics.py b/synapse/metrics/background_process_metrics.py index 59d956dd9d..ad639fe223 100644 --- a/synapse/metrics/background_process_metrics.py +++ b/synapse/metrics/background_process_metrics.py @@ -236,7 +236,7 @@ def run_as_background_process( attributes={SynapseTags.REQUEST_ID: str(context)}, ) else: - ctx = nullcontext() # type: ignore[assignment] + ctx = nullcontext() with ctx: return await func(*args, **kwargs) except Exception: -- cgit 1.5.1