-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
From what I've seen in the code and behaviour after user (correct me if I'm wrong), currently the exponential reconnect backoff rate is a bit overboard.
The current formula is for reconnect wait is configured_wait * 10^retry_attemps
With defaults:
configured_wait: 5000max_retry_attemps: 10
You get an a reconnect pattern as such:
- 5,000 (5 Seconds)
- 50,000 (50 seconds)
- 500,000 (~8 minutes)
- 5,000,000 (~1 hour)
- 50,000,000 (~13 hours)
- 500,000,000 (~5 days)
- 5,000,000,000 (~57 days)
- 50,000,000,000 (~1.5 years)
- 500,000,000,000 (~15.8 years)
- 5,000,000,000,000 (~158 years)
As you can see the numbers get pretty high even if only after the 3rd attempt. This potentially locks your process up with no hope of reconnecting in a viable timeframe. IMHO this completely defeats the purpose of the reconnect function.
My suggestion would be to set-up an exponential back-off rate which plateaus towards a maximum wait time. Graph would something like this: https://en.wikipedia.org/wiki/Sigmoid_function
Metadata
Metadata
Assignees
Labels
No labels