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

Better retry config #124

Merged
merged 3 commits into from
Dec 8, 2020
Merged

Better retry config #124

merged 3 commits into from
Dec 8, 2020

Conversation

dirkmc
Copy link
Contributor

@dirkmc dirkmc commented Dec 4, 2020

Adds a backoffFactor option for network open stream retry configuration.

Previously the backoffFactor was set to the same value as maxStreamOpenAttempts.

Also fixes a bug where in practice one extra attempt would be made over the configured number of attempts.

return nil, xerrors.Errorf("exhausted %d attempts but failed to open stream, err: %w", impl.maxStreamOpenAttempts, err)
// b.Attempt() starts from zero
nAttempts := b.Attempt() + 1
if nAttempts >= impl.maxStreamOpenAttempts {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really related to this PR, but I am not sure why these counters are float64s (both maxStreamOpenAttempts and b.Attempt()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question, I was wondering the same thing - basically it's because of the library we're using for the restart measurement

Copy link
Member

@nonsense nonsense left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@dirkmc dirkmc merged commit 34ebfef into master Dec 8, 2020
@dirkmc dirkmc deleted the fix/retry-attempt-count branch December 8, 2020 13:52
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.

2 participants