Skip to content

AIP-97 (2/3): classify Kubernetes pod failures as infra - #12

Draft
1fanwang wants to merge 1 commit into
aip97-p1-failure-contextfrom
aip97-p2-k8s-bridge
Draft

AIP-97 (2/3): classify Kubernetes pod failures as infra#12
1fanwang wants to merge 1 commit into
aip97-p1-failure-contextfrom
aip97-p2-k8s-bridge

Conversation

@1fanwang

@1fanwang 1fanwang commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Part 2 of 3, on top of 1/3. Consolidated view: apache/airflow#66405.

Why

1/3 gave the listener a failure_kind, but nothing sets infra yet. An eviction is visible only to the executor, which currently flattens it to a log string. This wires the Kubernetes executor to classify the failure by reading the pod failure details it already collects.

What

  • classify_pod_failure() maps the pod's failure shape to a kind. A node-level disruption (Evicted, Preempting, DisruptionTarget, node shutdown) or a pod removed while running (PodDeleted: drain, preemption, spot reclaim, force-delete) is infra; a container that died on its own, such as a crash or own-limit OOM, is application.
  • The classification rides a side channel on BaseExecutor that the scheduler reads once and passes to the listener, persisted as infra_reason.
  • An unclassified death stays None, so the scheduler never guesses infra.

No retry change here. An infra failure reaches the listener as failure_kind=infra but still spends the retry. The refund is 3/3.

Testing

test_classify_pod_failure: real V1Pod reads (Evicted to infra, OOMKilled to application, PodDeleted to infra), and the executor's failure-info handoff round-trips the classification once.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a6ae5a1d-2f37-49f6-9504-9ad2086e3b2e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch aip97-p2-k8s-bridge

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…he scheduler

The Kubernetes executor's classify_pod_failure() maps a node-level disruption
(Evicted, Preempting, DisruptionTarget, node shutdown) or a pod removed while
its task is running (PodDeleted — drain, preemption, spot reclaim, force-delete)
to failure_kind=infra; a container that ended on its own (an app crash, an OOM
against its own limit) to application. The classification rides a side channel on
BaseExecutor that the scheduler reads once and passes to the listener with the
executor's reason token. An unclassified death stays None, so the scheduler stays
conservative and never guesses infra.

Builds on the failure_kind foundation; the opt-in retry refund follows.

Signed-off-by: 1fanwang <1fannnw@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant