o-nikolas commented on code in PR #41083:
URL: https://github.com/apache/airflow/pull/41083#discussion_r1757418273


##########
airflow/jobs/scheduler_job_runner.py:
##########
@@ -1782,24 +1782,22 @@ def _fail_tasks_stuck_in_queued(self, session: Session 
= NEW_SESSION) -> None:
 
         for executor, stuck_tis in 
self._executor_to_tis(tasks_stuck_in_queued).items():
             try:
-                cleaned_up_task_instances = 
set(executor.cleanup_stuck_queued_tasks(tis=stuck_tis))
-                for ti in stuck_tis:
-                    if repr(ti) in cleaned_up_task_instances:
-                        self.log.warning(
-                            "Marking task instance %s stuck in queued as 
failed. "
-                            "If the task instance has available retries, it 
will be retried.",
-                            ti,
-                        )
-                        session.add(
-                            Log(
-                                event="stuck in queued",
-                                task_instance=ti.key,
-                                extra=(
-                                    "Task will be marked as failed. If the 
task instance has "
-                                    "available retries, it will be retried."
-                                ),
-                            )
+                for ti in executor.cleanup_stuck_queued_tasks(tis=stuck_tis):
+                    self.log.warning(
+                        "Marking task instance %s stuck in queued as failed. "
+                        "If the task instance has available retries, it will 
be retried.",
+                        ti,
+                    )
+                    session.add(
+                        Log(
+                            event="stuck in queued",
+                            task_instance=ti.key,

Review Comment:
   I'm probably missing something (tired from 3 days of a conferences 
:sweat_smile:) Are we handling any back compat here? If this scheduler code 
runs with an old executor it's going to try use `ti` as if it's a TI object but 
it will be a string, right?



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