cbuffett commented on issue #34497:
URL: https://github.com/apache/airflow/issues/34497#issuecomment-1853083625

   Unfortunately I'm still seeing the infinite rescheduling issue after 
upgrading to Airflow 2.7.2. I believe the issue still revolves around the fact 
that the following code returns an empty list, even on subsequent rescheduled 
executions:
   
   ```
               task_reschedules = TaskReschedule.find_for_task_instance(
                   context["ti"], try_number=first_try_number
               )  # <-- This call is returning an empty list
               if not task_reschedules:
                   start_date = timezone.utcnow()
               else:
                   start_date = task_reschedules[0].start_date
   ```
   
   Because this list is empty, `start_date` is always `utcnow()`, so it never 
fails the timeout check further down:
   
   ```
               if run_duration() > self.timeout:
                   # If sensor is in soft fail mode but times out raise 
AirflowSkipException.
                   message = (
                       f"Sensor has timed out; run duration of {run_duration()} 
seconds exceeds "
                       f"the specified timeout of {self.timeout}."
                   )
   
                   if self.soft_fail:
                       raise AirflowSkipException(message)
                   else:
                       raise AirflowSensorTimeout(message)
   ```


-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to