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


##########
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:
   `ser_dag` is of the type: `SerializedDAG` so we cannot directly do that.
   
   But `getattr(ser_dag, "fail_fast", False)` should work, let me try that.



##########
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):
+                task_dict = ser_dag.__dict__.get("task_dict", {})

Review Comment:
   Hmm, should never be the case. Just added as a safety hatch.



-- 
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-unsubscr...@airflow.apache.org

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

Reply via email to