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

chore: increase topics reconnect delay to 500ms #1431

Merged
merged 2 commits into from
Aug 30, 2024
Merged

Conversation

anitarua
Copy link
Contributor

@anitarua anitarua commented Aug 30, 2024

Previously, discontinuities were never shown. Increases the delay for attempting to reconnect to 5 seconds to match the go sdk, which did show discontinuities after resubscribing.

I think increasing the delay gives the server a little more breathing room to figure out that a reconnect had occurred and to send a discontinuity message to indicate the stream may have been interrupted.

Just increases delay for resubscribing to 500ms.
Discontinuities will be seen for network interruptions longer than the server message buffer (currently 5s).

@anitarua anitarua marked this pull request as ready for review August 30, 2024 17:24
@anitarua anitarua requested a review from a team August 30, 2024 17:24
@@ -260,7 +260,7 @@ export abstract class AbstractPubsubClient<TGrpcError>
// transparently restart the stream instead of propagating an error.
if (shouldReconnectSubscription) {
options.restartedDueToError = true;
const reconnectDelayMillis = 100;
const reconnectDelayMillis = 5000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think let's be careful not to conflate 2 things here.

Thing 1: what is a good value to use here for UX. It might be higher than 100 but it's probably less than 5000.
Thing 2: regardless of connect/disconnect status, you will only see a discontinuity if you miss messages. The server buffers the last 5 seconds worth of messages, so if you reconnect in less than 5s, you won't get one. But I think that for your demo purposes if you leave the connection blocked for more than 5s, you will get a discontinuity even if this reconnect attempt is happening every 100ms?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yeah you're right, I forgot about the 5s buffer 🙃

do you think it would still be worthwhile to increase the delay from 100 to maybe 1000?
otherwise I can just close this pr

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we should start a thread about that in slack. i can seed it.

@anitarua anitarua requested a review from cprice404 August 30, 2024 18:41
@anitarua anitarua changed the title chore: increase topics reconnect delay to see discontinuities chore: increase topics reconnect delay to 500ms Aug 30, 2024
@anitarua anitarua merged commit c689182 into main Aug 30, 2024
13 checks passed
@anitarua anitarua deleted the topics-reconnect branch August 30, 2024 20:35
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