KlarenceNicolasCatalan commented on code in PR #55660:
URL: https://github.com/apache/airflow/pull/55660#discussion_r2396378655


##########
airflow-core/src/airflow/models/taskinstance.py:
##########
@@ -217,13 +218,22 @@ def clear_task_instances(
     from airflow.models.dagbag import DBDagBag
 
     scheduler_dagbag = DBDagBag(load_op_links=False)
+    task_confirmed_running = False
     for ti in tis:
         task_instance_ids.append(ti.id)
         ti.prepare_db_for_next_try(session)
+
+        if prevent_running_task:
+            # If the task contains the message, prevent the task from running.
+            task_confirmed_running = True
+
         if ti.state == TaskInstanceState.RUNNING:
+            if task_confirmed_running:

Review Comment:
   At first the restarting and up_for_retry were included as the check was done 
in the UI, but after moving it in the backend and discovered that there is 
already an existing check in `taskinstance.py`, so I left the check as it is 
(checking only if task is in running state).  



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