AIP-97 (1/3): add failure_kind to the task-failure listener + infra_reason column - #11
Draft
1fanwang wants to merge 1 commit into
Draft
AIP-97 (1/3): add failure_kind to the task-failure listener + infra_reason column#111fanwang wants to merge 1 commit into
1fanwang wants to merge 1 commit into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
This was referenced Jul 24, 2026
…column on_task_instance_failed gains an optional failure_kind argument, a TaskFailureKind str enum (infra / application / timeout / manual) in airflow_shared.state. pluggy dispatches by parameter name, so a listener that does not declare it keeps working. The worker populates application or timeout; a manual mark-failed populates manual. The executor's reason token persists on the task instance as a new nullable infra_reason column. Foundation for AIP-97; the Kubernetes classifier (infra) and the opt-in retry refund follow as separate PRs. Signed-off-by: 1fanwang <1fannnw@gmail.com>
1fanwang
force-pushed
the
aip97-p1-failure-context
branch
from
July 27, 2026 20:01
519dc7e to
f6f1416
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 1 of 3 of the AIP-97 stack. Consolidated view with the whole design and e2e: apache/airflow#66405.
Why
on_task_instance_failedsees only the worker-sideerror. When a task is killed from outside, such as a pod eviction, OOM kill, force-deleted pod, or lost heartbeat, the worker never raises. The listener gets no cause. An eviction and a realValueErrorlook identical to alerting and lineage.What
Foundation only, with no executor wiring or retry change yet:
on_task_instance_failedgains an optionalfailure_kindenum:infra,application,timeout, ormanual. pluggy matches by name, so a listener that omits it keeps working.applicationortimeout; a manual mark-failed setsmanual.infraarrives with the executor bridge (2/3).infra_reasoncolumn ontask_instanceholds the executor's reason token.Testing
test_listener_types: a listener declaringfailure_kindreceives it, and one that omits it still fires.airflow db migratecreates theinfra_reasoncolumn.Stack
failure_kindplusinfra_reason