Uh oh!
There was an error while loading. Please reload this page.
Handle 'fail_fast' dags with task sdk and execution API server - #49045
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
amoghrajesh
commented
Apr 10, 2025
amoghrajesh
commented
Apr 10, 2025
Okay i just pushed another commit which imo will handle the tests now. Do we need a cadwyn migration? (New field "Request" has been added to the api) |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
amoghrajesh
commented
Apr 10, 2025
The failure isnt related to the PR, example of another one https://github.com/apache/airflow/actions/runs/14382075973/job/40328612380?pr=49059 It is being handled as we speak |

closes: #44951
What?
Dags have a property
fail_fast: Fails currently running tasks when task in DAG fails. Warning: A fail stop dag can only have tasks with the default trigger rule (“all_success”). An exception will be thrown if any task in a fail stop dag has a non default trigger rule.This is a property which is kinda used in a way that is a task fails, all its upstream "running" TIs should fail if they are non teardown.
Approach
fail_stop/fast_failis set from the execution side, we can know it earlier itself during parse time.update_statecall in the api server, we will check if it is from a fail stop dag, if yes, we construct the information needed for the exisiting logic: https://github.com/apache/airflow/blob/main/airflow-core/src/airflow/models/taskinstance.py#L395-L423 to mark all the downstream TIs as failed.This information involves:
task_teardown_mapto the earlier logic: https://github.com/apache/airflow/blob/main/airflow-core/src/airflow/models/taskinstance.py#L395-L423{task-id: if the task is a teardown one}
Testing
DAG:
Before:
After:
Task 1 fails cos of wrong assert

All other running tasks, end, end1 and end2 fail:

Audit log entries:

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.