ephraimbuddy commented on a change in pull request #19123:
URL: https://github.com/apache/airflow/pull/19123#discussion_r734293877



##########
File path: airflow/jobs/scheduler_job.py
##########
@@ -532,7 +532,9 @@ def _process_executor_events(self, session: Session = None) 
-> int:
                 self.log.info("Setting external_id for %s to %s", ti, info)
                 continue
 
-            if ti.try_number == buffer_key.try_number and ti.state == 
State.QUEUED:
+            if ti.try_number == buffer_key.try_number and (
+                ti.state == State.QUEUED and not 
TaskReschedule.find_for_task_instance(ti, session=session)
+            ):

Review comment:
       We will need some unittest to verify this. Also, I think you're running 
a lot of queries here to check if the ti is a task reschedule.
   
   Do you have a dag to reproduce this behaviour?




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