Manual success of a mid-pipeline task triggers its downstream even though an upstream sensor is still deferred (question about none_failed behavior) #45292
Labels
area:core
area:Scheduler
including HA (high availability) scheduler
kind:bug
This is a clearly a bug
Apache Airflow version
Other Airflow 2 version (please specify below)
If "Other Airflow 2 version" selected, which one?
2.10.1
What happened?
I have a DAG with three tasks in sequence:
wait_for_3am (a DateTimeSensorAsync), which waits until 3:00 AM and thus remains in deferred state until the target time.
empty_task_1 (an EmptyOperator), which depends on wait_for_3am.
empty_task_2 (another EmptyOperator), which depends on empty_task_1.
All tasks inherit the default trigger rule of none_failed. According to the documentation for none_failed, all upstream tasks must have “not failed or upstream_failed” (i.e. they should have succeeded or been skipped) in order to trigger the downstream tasks.
However, if I manually mark empty_task_1 as success while wait_for_3am is still in the deferred state (i.e., it has neither failed nor succeeded yet), then empty_task_2 immediately runs. From a scheduler standpoint, empty_task_2 sees empty_task_1 = success and therefore proceeds under none_failed, even though wait_for_3am has not actually completed.
What you think should happen instead?
I expected that if an upstream sensor (wait_for_3am) is still in a non-terminal (deferred) state, marking empty_task_1 as success would not trigger empty_task_2 immediately .
How to reproduce
Try this DAG, mark empty_task_1 as success .
Operating System
RHEL8
Versions of Apache Airflow Providers
No response
Deployment
Virtualenv installation
Deployment details
No response
Anything else?
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: