canyang25 commented on code in PR #74212:
URL: https://github.com/apache/airflow/pull/74212#discussion_r4747337545


##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -1546,7 +1564,8 @@ def process_executor_events(
         # row lock this entire set of taskinstances to make sure the scheduler 
doesn't fail when we have
         # multi-schedulers
         locked_query = with_row_locks(query, of=TI, session=session, 
skip_locked=True)
-        tis: Iterator[TI] = 
session.scalars(locked_query.execution_options(populate_existing=True))
+        tis: Sequence[TI] = 
list(session.scalars(locked_query.execution_options(populate_existing=True)))
+        rescheduled_ti_ids = cls._find_rescheduled_ti_ids(tis, session=session)

Review Comment:
   The reschedule lookup now only considers task instances whose executor event 
is SUCCESS and whose state is scheduled or queued with next_method unset. When 
that set is empty, the query is skipped. 
test_process_executor_events_skips_reschedule_lookup_without_success_event 
covers QUEUED and RUNNING events for both states, with a task_reschedule row 
present, and asserts that the executor id is still recorded while no 
task_reschedule statement is issued.



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