yulit0738 commented on PR #64087:
URL: https://github.com/apache/airflow/pull/64087#issuecomment-4108230941

   
   > `TraceContextTextMapPropagator().extract()` already has logic to deal with 
None and empty dict. I am under the impression these are expected values that 
should go through the same code path, not silently excluded early.
   
   @uranusjr  verified against the latest `opentelemetry-python` main — 
`TraceContextTextMapPropagator.extract()` has no `None` guard for carrier. 
[`DefaultGetter.get()`](https://github.com/open-telemetry/opentelemetry-python/blob/main/opentelemetry-api/src/opentelemetry/propagators/textmap.py#L86)
 calls
      `carrier.get(key, None)` directly, which raises `AttributeError` on 
`None`.
   
     The `context_carrier` column is 
[`nullable=True`](https://github.com/apache/airflow/blob/main/airflow-core/src/airflow/models/dagrun.py#L216-L219).
 After upgrading Airflow to a version with OTel tracing, existing DagRuns in 
the DB have `context_carrier = NULL`. When those DagRuns complete,
     the scheduler crashes in `_emit_dagrun_span()` — not a task failure, but a 
scheduler process crash.
   
     `task_runner.py:148` already uses the same pattern: `if 
msg.ti.context_carrier else None`.
   
     I can narrow the guard to only `None` (not empty dict) if you prefer — 
`{}` does pass through `extract()` safely.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to