You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/12/07 05:57:45 UTC

[GitHub] [airflow] uranusjr commented on a diff in pull request #28172: Handle OverflowError on exponential backof in next_run_calculation

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


##########
airflow/models/taskinstance.py:
##########
@@ -1144,7 +1144,10 @@ def next_retry_datetime(self):
             delay = timedelta(seconds=delay_backoff_in_seconds)
             if self.task.max_retry_delay:
                 delay = min(self.task.max_retry_delay, delay)
-        return self.end_date + delay
+        try:
+            return self.end_date + delay
+        except OverflowError:
+            return pendulum.DateTime.max

Review Comment:
   I agree with Jed; the retry process is already at a dead end when OverflowError is encountered. Setting the date to 9999-12-31 fixes the immediate crash, but still means the retry would be stuck in the system forever (ish). It’d be better to either have a hard-limit on retry backoff (as proposed), or just give up retrying entirely (and mark the ti as failed) when backoff goes past a certain threshold.



-- 
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-unsubscribe@airflow.apache.org

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