[core] Fix overflow on exponential backoff multiplication#62366
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request enhances the ExponentialBackoff utility by implementing explicit overflow checks for both the exponential calculation and the multiplication with the base delay. Unit tests were updated to include scenarios where multiplication would overflow. Review feedback recommends using bitwise shifts instead of floating-point math for power-of-two calculations and optimizing the test suite by moving invariant logic out of loops.
rueian
approved these changes
Apr 6, 2026
jeffreywang88
pushed a commit
that referenced
this pull request
Apr 10, 2026
We guarded against overflow by checking the result of the exponential, but there could still be an overflow when multiplying against `base_ms`. --------- Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
aslonnie
added a commit
that referenced
this pull request
Apr 11, 2026
## Description - #62323 - #62330 - #62366 ## Related issues > Link related issues: "Fixes #1234", "Closes #1234", or "Related to #1234". ## Additional information > Optional: Add implementation details, API changes, usage examples, screenshots, etc. --------- Signed-off-by: Jeffrey Wang <jeffreywang@anyscale.com> Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: kourosh hakhamaneshi <31483498+kouroshHakha@users.noreply.github.com> Co-authored-by: Edward Oakes <ed.nmi.oakes@gmail.com> Co-authored-by: Lonnie Liu <95255098+aslonnie@users.noreply.github.com>
Lucas61000
pushed a commit
to Lucas61000/ray
that referenced
this pull request
May 15, 2026
…t#62366) We guarded against overflow by checking the result of the exponential, but there could still be an overflow when multiplying against `base_ms`. --------- Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
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.
We guarded against overflow by checking the result of the exponential, but there could still be an overflow when multiplying against
base_ms.