Skip to content

Conversation

@github-actions
Copy link

This handles overflow when calculating the next execution time for a task instance by falling back to the configured maximum delay. The solution uses the same strategy that tenacity uses:
https://github.com/jd/tenacity/blob/main/tenacity/wait.py#L167

An alternate solution would be the determine the maximum tries that wouldn't exceed the maximum delay and then not calculate the timeout for values larger than that.

Something like

max_delay = self.task.max_retry_delay if self.task.max_retry_delay is not null else MAX_RETRY_DELAY
tries_before_max_delay = math.floor(math.log2(max_delay))
if self.try_number <= tries_before_max_delay:
     # existing logic
else:
    delay = max_delay

(cherry picked from commit 33658f0)

Co-authored-by: perry2of5 perry2of5@yahoo.com
closes: #47971

…8557)

This handles overflow when calculating the next execution time for a task instance by falling back to the configured maximum delay. The solution uses the same strategy that tenacity uses:
https://github.com/jd/tenacity/blob/main/tenacity/wait.py#L167

An alternate solution would be the determine the maximum tries that wouldn't exceed the maximum delay and then not calculate the timeout for values larger than that.

Something like

```
max_delay = self.task.max_retry_delay if self.task.max_retry_delay is not null else MAX_RETRY_DELAY
tries_before_max_delay = math.floor(math.log2(max_delay))
if self.try_number <= tries_before_max_delay:
     # existing logic
else:
    delay = max_delay
```
(cherry picked from commit 33658f0)

Co-authored-by: perry2of5 <perry2of5@yahoo.com>
closes: #47971
@kaxil kaxil marked this pull request as ready for review August 13, 2025 12:39
@kaxil kaxil requested review from XD-DENG and ashb as code owners August 13, 2025 12:39
@kaxil kaxil merged commit ed08b53 into v3-0-test Aug 13, 2025
49 checks passed
@kaxil kaxil deleted the backport-33658f0-v3-0-test branch August 13, 2025 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants