anishgirianish commented on PR #60755: URL: https://github.com/apache/airflow/pull/60755#issuecomment-3779254194
Hi @pierrejeambrun,
Thank you for reviewing this PR. I appreciate your patience.
I believe this issue still exists in 3.x/main and wanted to share my
understanding - please correct me if I'm wrong.
Reproduction steps (on main):
1. Create a DAG: long_running_task >> downstream_task
2. Trigger the DAG, wait for long_running_task to start
3. Mark DAG as "Failed" via UI while it's running
4. Observe DAG state changes from "Failed" back to "Success."
Why I think this happens (code in main):
- set_dag_run_state_to_failed() sets pending tasks to SKIPPED
(mark_tasks.py:342)
- _tis_for_dagrun_state() only checks leaf tasks for DAG state
(dagrun.py:1009-1013)
- SKIPPED is in State.success_states (state.py:203-205)
- So when the scheduler calls update_state(), it sees the leaf task is
SKIPPED (success) and overrides DAG to SUCCESS
I've added a test test_dag_run_state_persists_after_update_state that
demonstrates this behavior on main.
Could you please point out if my analysis is incorrect? Happy to make any
changes you suggest.
Thank you for your guidance!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
