uranusjr commented on code in PR #48557:
URL: https://github.com/apache/airflow/pull/48557#discussion_r2162960997


##########
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:
   Can you point me to another instance we do this kind of limiting? (We seem 
to only catch OverflowError in one other place and it’s for a different purpose)



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