pierrejeambrun commented on code in PR #49752:
URL: https://github.com/apache/airflow/pull/49752#discussion_r2063285002
##########
airflow-core/src/airflow/api/common/mark_tasks.py:
##########
@@ -215,17 +215,35 @@ def set_dag_run_state_to_success(
if not run_id:
raise ValueError(f"Invalid dag_run_id: {run_id}")
- # Mark all task instances of the dag run to success - except for teardown
as they need to complete work.
+ # Mark all task instances of the dag run to success - except for running
teardown as they need to complete work.
normal_tasks = [task for task in dag.tasks if not task.is_teardown]
+ teardown_tasks = [task for task in dag.tasks if task.is_teardown]
+ running_states = (
+ TaskInstanceState.RUNNING,
+ TaskInstanceState.DEFERRED,
+ TaskInstanceState.UP_FOR_RESCHEDULE,
+ )
Review Comment:
Should we instead use `State.unfinished` ? I know we do that in the
`mark_as_failed` function, but it seems that `TaskInstanceState.RESTARTING`, or
`TaskInstanceState.UP_FOR_RETRY` etc... shouldn't be marked as success too
early.
--
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]