edwardwang888 commented on a change in pull request #17003:
URL: https://github.com/apache/airflow/pull/17003#discussion_r713236538
##########
File path: airflow/models/taskinstance.py
##########
@@ -939,9 +939,9 @@ 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.
- min_backoff = int(math.ceil(delay.total_seconds() * (2 **
(self.try_number - 2))))
+ # we must impose a lower bound of 1 prior to converting to an int,
otherwise a divide
+ # by zero error will occur in the modded_hash calculation.
+ min_backoff = int(max(1, delay.total_seconds() * (2 **
(self.try_number - 2))))
Review comment:
@eladkal Yes, sorry about the delay. I plan to finish it sometime this
week - hopefully it should be a small change.
--
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]