You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "RachitSharma2001 (via GitHub)" <gi...@apache.org> on 2023/02/23 17:24:00 UTC

[GitHub] [airflow] RachitSharma2001 commented on a diff in pull request #29406: Add Fail Fast feature for DAGs

RachitSharma2001 commented on code in PR #29406:
URL: https://github.com/apache/airflow/pull/29406#discussion_r1116018115


##########
airflow/models/taskinstance.py:
##########
@@ -172,6 +172,19 @@ def set_current_context(context: Context) -> Generator[Context, None, None]:
             )
 
 
+def stop_all_tasks_in_dag(tis: list[TaskInstance], session: Session, task_id_to_ignore: int):
+    for ti in tis:
+        if ti.task_id == task_id_to_ignore or ti.state in (
+            TaskInstanceState.SUCCESS,
+            TaskInstanceState.FAILED,
+        ):
+            continue
+        if ti.state == TaskInstanceState.RUNNING:
+            ti.error(session)

Review Comment:
   Sounds good! I have added a logging statement for when a running task is being force failed, and when a task is being set to the skipped state. Let me know if these log statements are good or if there are anything to change.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org