Skip to content

Add backoff for post-handshake reconnects. - #587

Merged
polygon-derek merged 3 commits into
masterfrom
derekm/websocket-retry-backoff
Jul 28, 2026
Merged

Add backoff for post-handshake reconnects.#587
polygon-derek merged 3 commits into
masterfrom
derekm/websocket-retry-backoff

Conversation

@polygon-derek

Copy link
Copy Markdown
Contributor

Prior to this change, the client would immediately attempt to reconnect to the server without any backoff when it encountered errors after the initial authentication handshake. This resulted in excessive reconnect attempts.

This commit prevents the backoff-retry logic from resetting its timer unless the connection has been stable for more than 2 minutes, which is double the configured max backoff interval (excluding jitter).

Prior to this change, the client would immediately attempt to
reconnect to the server without any backoff when it encountered
errors after the initial authentication handshake. This resulted
in excessive reconnect attempts.

This commit prevents the backoff-retry logic from resetting its
timer unless the connection has been stable for more than 2 minutes,
which is double the configured max backoff interval (excluding jitter).
Comment thread websocket/client.go
Comment thread websocket/client.go
Comment thread websocket/client.go
Comment thread websocket/client.go
@polygon-derek
polygon-derek marked this pull request as ready for review July 21, 2026 17:08
@polygon-derek
polygon-derek requested a review from a team as a code owner July 21, 2026 17:08
@polygon-derek
polygon-derek force-pushed the derekm/websocket-retry-backoff branch 4 times, most recently from 7b63449 to 6e7d401 Compare July 28, 2026 14:10
@polygon-derek
polygon-derek force-pushed the derekm/websocket-retry-backoff branch from 6e7d401 to 99eea35 Compare July 28, 2026 14:18
@polygon-derek
polygon-derek merged commit eef5a9a into master Jul 28, 2026
9 checks passed
@polygon-derek
polygon-derek deleted the derekm/websocket-retry-backoff branch July 28, 2026 14:40
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