cap retry delays without float overflow - #1402
Merged
Merged
Conversation
bgentry
force-pushed
the
bg/cap-retry-delays
branch
from
September 28, 2026 02:16
d303827 to
744a6e1
Compare
brandur
approved these changes
Sep 28, 2026
From the 310th error on, the default retry policy caps its delay at the maximum `time.Duration`, but it converts the capped value from float seconds with `timeutil.SecondsAsDuration`. That float is 2^63 nanoseconds, one past the largest `int64`, and Go leaves out-of-range float-to-integer conversions implementation-specific: arm64 saturates, while amd64 produces the minimum `int64`, scheduling the retry about 292 years in the past so the job runs again immediately. Return the maximum duration directly whenever the seconds reach the cap, and make the existing cap test expect the exact maximum instead of recomputing it with the same overflowing conversion.
bgentry
force-pushed
the
bg/cap-retry-delays
branch
from
September 28, 2026 15:26
744a6e1 to
70c50ee
Compare
bgentry
marked this pull request as ready for review
September 28, 2026 15:26
bgentry
enabled auto-merge (squash)
September 28, 2026 15:27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From the 310th error onward, the default retry policy caps its delay at the maximum
time.Duration. Converting that cap through float seconds can produce the minimumint64on amd64, scheduling retries roughly 292 years in the past and causing jobs with many allowed attempts to run again immediately.Return the maximum duration directly at the cap. The cap test now expects that exact duration, and the changelog records the fix.