-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
fix multiple overflow errors in exponential backoff #18200
Merged
Merged
Commits on Aug 14, 2023
-
fix multiple overflow errors in exponential backoff
We use capped exponential backoff in several places in the code when handling failures. The code we've copy-and-pasted all over has a check to see if the backoff is greater than the limit, but this check happens after the bitshift and we always increment the number of attempts. This causes an overflow with a fairly small number of failures (ex. at one place I tested it occurs after only 24 iterations), resulting in a negative backoff which then never recovers. The backoff becomes a tight loop consuming resources and/or DoS'ing a Nomad RPC handler or an external API such as Vault. Note this doesn't occur in places where we cap the number of iterations so the loop breaks (usually to return an error), so long as the number of iterations is reasonable. Introduce a check on the cap before the bitshift to avoid overflow in all places this can occur. Fixes: #18199
Configuration menu - View commit details
-
Copy full SHA for c326e0a - Browse repository at this point
Copy the full SHA c326e0aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 676d15a - Browse repository at this point
Copy the full SHA 676d15aView commit details
Commits on Aug 15, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 379a3ac - Browse repository at this point
Copy the full SHA 379a3acView commit details -
Configuration menu - View commit details
-
Copy full SHA for bc7f360 - Browse repository at this point
Copy the full SHA bc7f360View commit details -
Configuration menu - View commit details
-
Copy full SHA for 04dcb90 - Browse repository at this point
Copy the full SHA 04dcb90View commit details -
Configuration menu - View commit details
-
Copy full SHA for dd00966 - Browse repository at this point
Copy the full SHA dd00966View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1f92874 - Browse repository at this point
Copy the full SHA 1f92874View commit details -
Configuration menu - View commit details
-
Copy full SHA for dd46498 - Browse repository at this point
Copy the full SHA dd46498View commit details
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.