The GitHub Actions job "Tests (AMD)" on 
airflow.git/fix-otel-detach-context-execution-api has failed.
Run started by GitHub user dheerajturaga (triggered by dheerajturaga).

Head commit for run:
3501422a4a523334c4e505711c7b01e89ce92bd0 / Dheeraj Turaga 
<[email protected]>
Fix spurious "Failed to detach context" error on Execution API disconnects

The Execution API trace-propagation dependency attaches an OpenTelemetry
context before yielding and detaches it afterwards. When a client disconnects
or the request is cancelled, the dependency generator is force-closed from a
different asyncio task, so the detach ran against a contextvars.Token created
in a different Context. OpenTelemetry caught and logged that ValueError at
ERROR ("Failed to detach context") before our suppression could see it,
producing alarming but harmless log noise on the Dag processor and other
clients.

Skip the detach only on the GeneratorExit force-close path, where the
originating Context is being discarded anyway. On all same-task unwind paths
-- normal completion and a route handler raising (which FastAPI throws into
the generator at the yield) -- detach as before so the upstream trace context
does not leak into the exception handler, the error response, or error-path
spans. The route-error detach is suppressed so it can never mask the original
exception.

Report URL: https://github.com/apache/airflow/actions/runs/26992048309

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to