amoghrajesh commented on code in PR #49045:
URL: https://github.com/apache/airflow/pull/49045#discussion_r2037453767


##########
airflow-core/src/airflow/models/taskinstance.py:
##########
@@ -411,13 +411,21 @@ def _stop_remaining_tasks(*, task_instance: TaskInstance, 
session: Session):
             TaskInstanceState.FAILED,
         ):
             continue
-        task = task_instance.task.dag.task_dict[ti.task_id]
-        if not task.is_teardown:
+        if task_teardown_map:
+            teardown = task_teardown_map[ti.task_id]
+        else:
+            task = task_instance.task.dag.task_dict[ti.task_id]
+            teardown = task.is_teardown
+        if not teardown:
             if ti.state == TaskInstanceState.RUNNING:
                 log.info("Forcing task %s to fail due to dag's `fail_fast` 
setting", ti.task_id)
+                msg = f"Forcing task {ti.task_id} to fail due to `fail_fast` 
property set in the dag"

Review Comment:
   Handled in 94b1fcef4453d8a5e4f0277db0c399fccb5ebc81



##########
airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py:
##########
@@ -308,6 +310,15 @@ def ti_update_state(
         updated_state = ti_patch_payload.state
         query = TI.duration_expression_update(ti_patch_payload.end_date, 
query, session.bind)
         query = query.values(state=updated_state)
+
+        if updated_state == TerminalTIState.FAILED:
+            ti = session.get(TI, ti_id_str)
+            ser_dag = request.app.state.dag_bag.get_dag(dag_id)
+            if ser_dag and ser_dag.__dict__.get("fail_fast", False):

Review Comment:
   Handled in 94b1fcef4453d8a5e4f0277db0c399fccb5ebc81



-- 
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]

Reply via email to