Fix DagRun._emit_dagrun_span crash on None/empty context_carrier#64087
Conversation
|
|
@uranusjr verified against the latest The
I can narrow the guard to only |
|
Let’s pass |
DagRuns created before OTel tracing was enabled have context_carrier=NULL
in the database. When these DagRuns complete, _emit_dagrun_span() passes
None to TraceContextTextMapPropagator().extract(), which crashes with
AttributeError: 'NoneType' object has no attribute 'get'.
Use `self.context_carrier or {}` so OTel receives a valid carrier and
emits a root span per the OTel spec, consistent with task_runner.py:148.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
bb9dd0f to
2ae69e0
Compare
|
@uranusjr You were right that this should go through the same code path. The only issue was |
Summary
Fixes a crash in
DagRun._emit_dagrun_span()whencontext_carrierisNoneor empty{}.AttributeError: 'NoneType' object has no attribute 'get'inTraceContextTextMapPropagator().extract()context_carrier = NULLin the database. When these DagRuns complete,_emit_dagrun_span()passesNonedirectly toextract().context_carrieris falsy, consistent with the existing guard intask_runner.py:148.Reproduction Path
context_carrier = NULL)update_state()→_emit_dagrun_span()→ crashNote: This supersedes #61655 which targeted
OtelTrace.extract()— that class was since removed in #63452.Testing
Noneand{}carrier valuesWas generative AI tooling used to co-author this PR?
Generated-by: Claude (Anthropic) following the guidelines