perry2of5 commented on code in PR #48557:
URL: https://github.com/apache/airflow/pull/48557#discussion_r2162175204
##########
airflow-core/src/airflow/models/taskinstance.py:
##########
@@ -1114,12 +1114,15 @@ def next_retry_datetime(self):
delay = self.task.retry_delay
if self.task.retry_exponential_backoff:
- # If the min_backoff calculation is below 1, it will be converted
to 0 via int. Thus,
- # we must round up prior to converting to an int, otherwise a
divide by zero error
- # will occur in the modded_hash calculation.
- # this probably gives unexpected results if a task instance has
previously been cleared,
- # because try_number can increase without bound
- min_backoff = math.ceil(delay.total_seconds() * (2 **
(self.try_number - 1)))
+ try:
+ # If the min_backoff calculation is below 1, it will be
converted to 0 via int. Thus,
+ # we must round up prior to converting to an int, otherwise a
divide by zero error
+ # will occur in the modded_hash calculation.
+ # this probably gives unexpected results if a task instance
has previously been cleared,
+ # because try_number can increase without bound
+ min_backoff = math.ceil(delay.total_seconds() * (2 **
(self.try_number - 1)))
+ except OverflowError:
+ min_backoff = MAX_RETRY_DELAY
Review Comment:
We don't warn when limiting the retry time for other reasons. I think it
should be consistent one way or the other. I'm happy to add a message here and
add another ticket to log when limiting the time until the next retry at other
locations. Thoughts?
--
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]