hussein-awala commented on code in PR #30571:
URL: https://github.com/apache/airflow/pull/30571#discussion_r1164687271
##########
airflow/sensors/base.py:
##########
@@ -251,7 +251,7 @@ def run_duration() -> float:
raise AirflowRescheduleException(reschedule_date)
else:
time.sleep(self._get_next_poke_interval(started_at,
run_duration, try_number))
- try_number += 1
+ try_number += 1
Review Comment:
When self.reschedule is True, `raise
AirflowRescheduleException(reschedule_date)` will stop the execution, and the
`try_number += 1` is not reached even if it's outside the else block.
Even if we add try...finally, updating the try_number cannot solve the
problem, because the try_number is resetting when we re-execute (reschedule)
the sensor.
IMO, the try_number state should be stored somewhere in order to use it in
the next reschedule (ex XCom)
--
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]