From 791d9d1b61bb78db382ef12bfd00a8b25fe7b421 Mon Sep 17 00:00:00 2001 From: Mads Bisgaard <126242332+bisgaard-itis@users.noreply.github.com> Date: Wed, 11 Dec 2024 15:13:24 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9BFix=20opentelemetry=20detach=20bug?= =?UTF-8?q?=20(#6941)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/service-library/src/servicelib/tracing.py | 7 ++++--- .../src/simcore_service_webserver/api/v0/openapi.yaml | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/service-library/src/servicelib/tracing.py b/packages/service-library/src/servicelib/tracing.py index 6635e824a46..e1b3b348a72 100644 --- a/packages/service-library/src/servicelib/tracing.py +++ b/packages/service-library/src/servicelib/tracing.py @@ -21,13 +21,14 @@ def get_context() -> TracingContext: @contextmanager def use_tracing_context(context: TracingContext): + token: object | None = None if context is not None: - otcontext.attach(context) + token = otcontext.attach(context) try: yield finally: - if context is not None: - otcontext.detach(context) + if token is not None: + otcontext.detach(token) def setup_log_tracing(tracing_settings: TracingSettings): diff --git a/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml b/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml index d27cbd9537e..ce36e2e6e93 100644 --- a/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml +++ b/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml @@ -10636,7 +10636,7 @@ components: read: true write: false description: Open to all users - gid: '0' + gid: 1 label: All me: accessRights: