You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Listener hook can't distinguish a task auto-retrying from a terminal failure #72379
on_task_instance_failed fires identically whether a task instance is about to be automatically
retried (state set to UP_FOR_RETRY) or has permanently failed (state set to FAILED). The hook
call in models/taskinstance.py sits after the retry-eligibility branch and fires unconditionally
either way, using the same hook name.
Use case/motivation
This makes the listener API noisy for a common use case: an alerting/paging integration built on on_task_instance_failed gets triggered on every transient retry of a flaky task, not just the
final terminal failure, which undermines the signal-to-noise of building alerting on this hook.
Airflow's listener spec already carves out sub-outcomes this way elsewhere — on_task_instance_skipped exists specifically to distinguish "skipped" from the generic
success/failure buckets. Same pattern fits here: a new on_task_instance_up_for_retry hookspec,
fired when a task instance is set to UP_FOR_RETRY, additive alongside the existing on_task_instance_failed (left unchanged, to avoid a breaking change for existing listeners).
Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.
Opened a draft PR with an implementation: #72424. Went with an additive-only approach (new hook, on_task_instance_failed left unchanged) to avoid a breaking change — see the PR description for the reasoning. Happy to rework based on feedback.
Closing to re-open this via GitHub's web form instead of the API, so the feature-request template's labels (kind:feature, needs-triage) get applied automatically — that only happens through the actual form, not gh issue create. Will link the new issue number here and re-target the open draft PR (#72424) to it.
Activity
boring-cyborg commentedon Sep 1, 2026
Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.
avanish-garg commentedon Sep 2, 2026
Opened a draft PR with an implementation: #72424. Went with an additive-only approach (new hook,
on_task_instance_failedleft unchanged) to avoid a breaking change — see the PR description for the reasoning. Happy to rework based on feedback.avanish-garg commentedon Sep 2, 2026
Closing to re-open this via GitHub's web form instead of the API, so the feature-request template's labels (
kind:feature,needs-triage) get applied automatically — that only happens through the actual form, notgh issue create. Will link the new issue number here and re-target the open draft PR (#72424) to it.