khmelevskiy opened a new pull request, #73165:
URL: https://github.com/apache/airflow/pull/73165

   `_change_state()` builds the `termination_reason` that the scheduler stores 
in the task's Event log
   (`Extra info: ...`) from `pod.status.reason` only. Kubernetes leaves that 
field empty for
   container-level failures such as OOMKilled or a non-zero exit, so an 
OOM-killed worker pod shows up as
   `Pod failed because of None` even though the executor already has 
`container_reason: OOMKilled,
   exit_code: 137` in `failure_details` (it logs them one line below).
   
   Fall back to the container reason and append the container name and exit 
code:
   
   ```
   Pod failed because of OOMKilled (container: base, exit code: 137)
   ```
   
   `pod.status.reason` still wins when set (`Pod failed because of Evicted`), 
and a pod with neither reason
   reads `Pod failed because of unknown reason` instead of `None`.
   
   closes: #73164
   related: #60800
   
   ## Testing
   
   ```
   uv run --project providers/cncf/kubernetes pytest \
     
providers/cncf/kubernetes/tests/unit/cncf/kubernetes/executors/test_kubernetes_executor.py
   ```
   
   New parametrized `test_change_state_failed_termination_reason` covers the 
three cases above.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes: Claude Code (Claude Fable 5.1)
   
   Generated-by: Claude Code following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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