Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent exponential backoff delay from overflowing #199

Open
wants to merge 1 commit into
base: v3
Choose a base branch
from

Conversation

skateinmars
Copy link

Because of the bit shifting used in the exponential backoff computation, an overflow can happen given some specific values for min/max backoff.

Here is a snippet to show the current and fixed behavior: https://go.dev/play/p/V2tno9piKly

This PR fixes it without trying to change the "normal" behavior by simply using the max backoff value when an overflow happens.

@skateinmars skateinmars force-pushed the fix/exponential-backoff-overflow branch from 8f03fe4 to 2ea58e8 Compare October 16, 2023 10:46
@skateinmars skateinmars force-pushed the fix/exponential-backoff-overflow branch from 2ea58e8 to fdf44a4 Compare October 16, 2023 11:02
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.

1 participant