Fix per-index evaluation of ONE_FAILED in mapped task groups#67684
Merged
kaxil merged 2 commits intoMay 29, 2026
Conversation
A task using a "fast triggered" trigger rule (ONE_FAILED, ONE_SUCCESS, ONE_DONE) inside a mapped task group was evaluated against every expanded instance of its upstream, instead of the upstream instance sharing its own map index. As a result a single failed (or succeeded) upstream instance wrongly triggered the rule for every expanded instance of the task — e.g. a mapped ONE_FAILED reporting task ran for all map indexes when only one upstream had failed. The broad "depend on every upstream instance" behavior is only needed for the not-yet-expanded summary task instance (map_index < 0), so a fast trigger rule does not prematurely skip the task before the mapped task group expands (the case fixed in apache#34023). Restrict that special case to the summary instance; expanded instances now use the normal per-map-index upstream resolution. closes: apache#50210
Contributor
Author
Contributor
|
Hi maintainer, this PR was merged without a milestone set.
|
Contributor
Backport successfully created: v3-2-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
github-actions Bot
pushed a commit
to aws-mwaa/upstream-to-airflow
that referenced
this pull request
May 29, 2026
…ups (apache#67684) A task using a "fast triggered" trigger rule (ONE_FAILED, ONE_SUCCESS, ONE_DONE) inside a mapped task group was evaluated against every expanded instance of its upstream, instead of the upstream instance sharing its own map index. As a result a single failed (or succeeded) upstream instance wrongly triggered the rule for every expanded instance of the task — e.g. a mapped ONE_FAILED reporting task ran for all map indexes when only one upstream had failed. The broad "depend on every upstream instance" behavior is only needed for the not-yet-expanded summary task instance (map_index < 0), so a fast trigger rule does not prematurely skip the task before the mapped task group expands (the case fixed in apache#34023). Restrict that special case to the summary instance; expanded instances now use the normal per-map-index upstream resolution. (cherry picked from commit 862b647) Co-authored-by: Shahar Epstein <60007259+shahar1@users.noreply.github.com> closes: apache#50210
aws-airflow-bot
pushed a commit
to aws-mwaa/upstream-to-airflow
that referenced
this pull request
May 29, 2026
…ups (apache#67684) A task using a "fast triggered" trigger rule (ONE_FAILED, ONE_SUCCESS, ONE_DONE) inside a mapped task group was evaluated against every expanded instance of its upstream, instead of the upstream instance sharing its own map index. As a result a single failed (or succeeded) upstream instance wrongly triggered the rule for every expanded instance of the task — e.g. a mapped ONE_FAILED reporting task ran for all map indexes when only one upstream had failed. The broad "depend on every upstream instance" behavior is only needed for the not-yet-expanded summary task instance (map_index < 0), so a fast trigger rule does not prematurely skip the task before the mapped task group expands (the case fixed in apache#34023). Restrict that special case to the summary instance; expanded instances now use the normal per-map-index upstream resolution. (cherry picked from commit 862b647) Co-authored-by: Shahar Epstein <60007259+shahar1@users.noreply.github.com> closes: apache#50210
vatsrahul1001
pushed a commit
that referenced
this pull request
May 29, 2026
…ups (#67684) (#67704) A task using a "fast triggered" trigger rule (ONE_FAILED, ONE_SUCCESS, ONE_DONE) inside a mapped task group was evaluated against every expanded instance of its upstream, instead of the upstream instance sharing its own map index. As a result a single failed (or succeeded) upstream instance wrongly triggered the rule for every expanded instance of the task — e.g. a mapped ONE_FAILED reporting task ran for all map indexes when only one upstream had failed. The broad "depend on every upstream instance" behavior is only needed for the not-yet-expanded summary task instance (map_index < 0), so a fast trigger rule does not prematurely skip the task before the mapped task group expands (the case fixed in #34023). Restrict that special case to the summary instance; expanded instances now use the normal per-map-index upstream resolution. (cherry picked from commit 862b647) closes: #50210 Co-authored-by: Shahar Epstein <60007259+shahar1@users.noreply.github.com>
vatsrahul1001
pushed a commit
that referenced
this pull request
May 29, 2026
…ups (#67684) (#67704) A task using a "fast triggered" trigger rule (ONE_FAILED, ONE_SUCCESS, ONE_DONE) inside a mapped task group was evaluated against every expanded instance of its upstream, instead of the upstream instance sharing its own map index. As a result a single failed (or succeeded) upstream instance wrongly triggered the rule for every expanded instance of the task — e.g. a mapped ONE_FAILED reporting task ran for all map indexes when only one upstream had failed. The broad "depend on every upstream instance" behavior is only needed for the not-yet-expanded summary task instance (map_index < 0), so a fast trigger rule does not prematurely skip the task before the mapped task group expands (the case fixed in #34023). Restrict that special case to the summary instance; expanded instances now use the normal per-map-index upstream resolution. (cherry picked from commit 862b647) closes: #50210 Co-authored-by: Shahar Epstein <60007259+shahar1@users.noreply.github.com>
sunildataengineer
pushed a commit
to sunildataengineer/airflow
that referenced
this pull request
May 30, 2026
…67684) A task using a "fast triggered" trigger rule (ONE_FAILED, ONE_SUCCESS, ONE_DONE) inside a mapped task group was evaluated against every expanded instance of its upstream, instead of the upstream instance sharing its own map index. As a result a single failed (or succeeded) upstream instance wrongly triggered the rule for every expanded instance of the task — e.g. a mapped ONE_FAILED reporting task ran for all map indexes when only one upstream had failed. The broad "depend on every upstream instance" behavior is only needed for the not-yet-expanded summary task instance (map_index < 0), so a fast trigger rule does not prematurely skip the task before the mapped task group expands (the case fixed in apache#34023). Restrict that special case to the summary instance; expanded instances now use the normal per-map-index upstream resolution. closes: apache#50210
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.

closes: #50210
A task using a "fast triggered" trigger rule (
ONE_FAILED,ONE_SUCCESS,ONE_DONE) inside a mapped task group was evaluated against every expanded instance of its upstream, instead of the upstream instance that shares its own map index. As a result, a single failed (or succeeded) upstream instance wrongly triggered the rule for every expanded instance of the task.For example, in the reproduction from the issue,
divide(0)fails whiledivide(1..3)succeed, yet the mappedreport_failuretask (ONE_FAILED) ran for all map indexes instead of only index0.Root cause
TriggerRuleDep._get_relevant_upstream_map_indexesshort-circuits to "depend on every upstream instance" for the fast-triggered rules when the upstream is not an expansion dependency of the group (introduced in #44937 to fix #34023). That broad behavior is only needed for the not-yet-expanded summary task instance (map_index < 0), so the task is not prematurely skipped before the mapped task group expands. Applying it to the already-expanded instances broke per-index correspondence.Fix
Restrict the special case to the summary instance (
ti.map_index < 0). Expanded instances now use the normal per-map-index upstream resolution, so eachreport_failure[k]depends ondivide[k]only.Tests
test_one_failed_trigger_rule_in_mapped_task_group_is_per_index(the issue's repro:report_failureis now{0: success, 1..3: skipped}).test_one_failed_trigger_rule_runs_on_indirect_failure_in_mapped_task_group(end-to-end guard for the Trigger Rule ONE_FAILED does not work in task group with mapped tasks #34023 behavior).test_mapped_tasks_in_mapped_task_group_waits_for_upstreams_to_complete([v2-10-test] Fix premature evaluation in mapped task group #44937, premature-skip guard) still passes.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 4.8) following the guidelines