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

Pause heartbeat detection during reconnection #1631

Closed
wants to merge 1 commit into from

Conversation

withinboredom
Copy link

Currently, reconnection may take many multiples of seconds to perform. However, heartbeat detection is still enabled during this period, making it extremely likely that the very first "message" after reconnection is a heartbeat failure.

This PR stops the heartbeat timer until a connection is successfully made.

Fixes #1622

@piotrpio
Copy link
Collaborator

Hey @withinboredom, thanks for the contribution! Instead of pausing the heartbeat on reconnect, the proper behavior would be to pause it on disconnect (currently we were resetting it). I fixed this as part of this PR: #1643

Again, thank you for the contribution and sorry for not checking it earlier.

@withinboredom
Copy link
Author

@piotrpio, thanks for the comment and glad it resulted in a better fix! Should we close this one?

@piotrpio piotrpio closed this Jun 17, 2024
@withinboredom withinboredom deleted the patch-1 branch June 17, 2024 18:20
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.

I often get the error nats: no heartbeat received
2 participants