dstandish commented on code in PR #41083:
URL: https://github.com/apache/airflow/pull/41083#discussion_r1757645032
##########
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:
You may be tired but you are not missing something
We do need to handle backcompat unless we are going to bump min version to
3.0 at some point
Asked about that here
https://apache-airflow.slack.com/archives/C06K9Q5G2UA/p1726148544916899
(And this pr is the motivation there)
--
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]