Skip to content

Add web socket Max backoff time#55

Merged
fbradyirl merged 7 commits into
mainfrom
reconnectsUpdate
Apr 24, 2024
Merged

Add web socket Max backoff time#55
fbradyirl merged 7 commits into
mainfrom
reconnectsUpdate

Conversation

@fbradyirl

Copy link
Copy Markdown
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
@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