Skip to content

Actually make sleepBeforeConnect() implement an exponential backoff#99

Merged
jmwample merged 1 commit intomasterfrom
ewust/exponential_backoff
Oct 3, 2022
Merged

Actually make sleepBeforeConnect() implement an exponential backoff#99
jmwample merged 1 commit intomasterfrom
ewust/exponential_backoff

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