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


##########
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:
   Also PR description also mention (scheduled and up_for_retry), but we seem 
to only handle `RUNNING` states) there, is that expected? 



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