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

Actually make sleepBeforeConnect() implement an exponential backoff #99

Merged
merged 1 commit into from
Oct 3, 2022

Conversation

ewust
Copy link
Member

@ewust ewust commented Sep 29, 2022

Currently, our sleepBeforeConnect() doesn't sleep for the first 6 connections, but then sleeps 1 second between retries after that.

That's too overwhelming, and not an exponential backoff. This change increases the exponential backoff to be 25*(2^n) milliseconds, up to 15 seconds, for retry n.

We may want to even increase the upper bound (15 seconds) to something larger (or remove the upper bound entirely)

@jmwample
Copy link
Member

jmwample commented Oct 3, 2022

I am happy to merge this as it is. I think we should consider adding config values to replace the constants (25 for the ramp, and 15s for max in this PR). These could even potentially go into the clientconf as a deployment setting so that clients have a more easily tunable backoff if things start to get overwhelmed. We might open an issue for that relating to #100

@jmwample jmwample merged commit c6f6a75 into master Oct 3, 2022
@jmwample jmwample deleted the ewust/exponential_backoff branch October 3, 2022 20: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