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.
Problem
num_retries
. If this managed to get up to32
, the retry_after procedure would compute 2^32 which would overflow to 0 and trigger a div by zeroa. We start in a
Cached
stateb.
Cached
: callconnect_once
. After the first connect_once error, we always move to theCacheInvalid
state, otherwise, we return the connection.c.
CacheInvalid
: we attempt towake_compute
and we either switch to Cached or we retry this step (or we error).d.
Cached
: callconnect_once
. We either retry this step or we have a connection (or we error) - After num_retries > 1 we never switch back toCacheInvalid
.Summary of changes
num_retries
check in thehandle_try_wake
procedure. Also using floats in the retry_after procedure to prevent the overflow entirelyChecklist before requesting a review
Checklist before merging