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 web socket Max backoff time #55

Merged
merged 7 commits into from
Apr 24, 2024
Merged

Add web socket Max backoff time #55

merged 7 commits into from
Apr 24, 2024

Conversation

fbradyirl
Copy link
Owner

The backoff.expo decorator provides "exponential backoff". This design pattern is common in connection recovery scenarios where multiple or continuous connection attempts might be penalized with temporary or permanent bans, or it might simply be a waste of resources when connection is not possible due to network conditions. By using an exponential backoff algorithm, each subsequent attempt waits for a longer delay between retries, thus reducing load and respecting policies.

However, we didnt have a maximum backoff time is specified. The calculation for the backoff time is (factor * (2 ** (num_retries - 1))) (num_retries gets incremented after each fail), where "factor" takes default value 1 second. After a number of failures, the delay between retries can become very long.

@fbradyirl fbradyirl merged commit ceebe78 into main Apr 24, 2024
1 of 4 checks passed
@fbradyirl fbradyirl deleted the reconnectsUpdate branch April 24, 2024 10:02
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.

1 participant