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

Add jitter during reconnect #563

Closed
ColinSullivan1 opened this issue May 1, 2020 · 4 comments · Fixed by #564
Closed

Add jitter during reconnect #563

ColinSullivan1 opened this issue May 1, 2020 · 4 comments · Fixed by #564
Assignees
Labels
bug Confirmed reproducible bug

Comments

@ColinSullivan1
Copy link
Member

Defect

Some jitter needs to be added during reconnect. One option would be waiting for a duration that is a percentage of Reconnect wait - it'd be easy for users to configure.

@ColinSullivan1 ColinSullivan1 added the bug Confirmed reproducible bug label May 1, 2020
@derekcollison derekcollison self-assigned this May 1, 2020
@derekcollison
Copy link
Member

We need jitter in all of our clients. I could have swore I had it in here to avoid thundering heard problems already.

@ripienaar
Copy link
Contributor

Have wanted this many times :)

@derekcollison
Copy link
Member

Maybe I am having a senior moment but could have swore I had it in there.

kozlovic added a commit that referenced this issue May 1, 2020
When library would wait for the reconnect wait interval, it will
now wait for a random time bounded by this value.
This prevents thundering herd reconnect issue, especially with
TLS.

Resolves #563

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
kozlovic added a commit that referenced this issue May 1, 2020
When library would wait for the reconnect wait interval, it will
now wait for a random time bounded by this value.
This prevents thundering herd reconnect issue, especially with
TLS.

Resolves #563

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
@ColinSullivan1
Copy link
Member Author

I remember something in there too at one point.

kozlovic added a commit that referenced this issue May 6, 2020
-Add ReconnectJitter option setter allowing user to set jitter
 for non and TLS connections (possibly different values)
-Default for non-TLS will be 100ms and TLS 1sec
-Add a CustomReconnectDelay handler that is passed the number
 of full url lists attempts. The user callback will then return
 a duration that is going to be used for the wait. It is the
 responsibility of the user to send a delay with some jitter
 if desired.

Resolves #563

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed reproducible bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants