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

Fix: Respect IReconnectRetryPolicy in disconnect loops #2853

Merged
merged 3 commits into from
Mar 4, 2025

Conversation

NickCraver
Copy link
Collaborator

Fixes the case where we loop from Connecting -> BeginConnectAsync -> OnDisconnected and the next heartbeat triggers a reconnect again due to the backoff thresholds resetting. This ultimately causes the backoff to not be respected.

Here, we're doing 2 things:

  • Upping the max exponential backoff window to 60 seconds which better handlers clients at scale and mass DDoS cases.
  • Only resets the reconnect counter on the first disconnect, not doing so again until we've successfully reconnected and heartbeated again, so backoffs are properly respected.

@NickCraver NickCraver merged commit 437e1ff into main Mar 4, 2025
4 of 6 checks passed
@NickCraver NickCraver deleted the craver/retry-backoff-respect branch March 4, 2025 16:22
NickCraver added a commit that referenced this pull request Mar 6, 2025
…2856)

Additional case handling for #2853, respecting backoff in the disconnected -> resurrecting state case. We need to check backoff in that flow as well to prevent a premature `TryConnect`.
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