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

Heartbeat: Heartbeat (server) inactivity not detected #148

Closed
Nestorfish opened this issue Oct 23, 2020 · 2 comments · Fixed by #149
Closed

Heartbeat: Heartbeat (server) inactivity not detected #148

Nestorfish opened this issue Oct 23, 2020 · 2 comments · Fixed by #149

Comments

@Nestorfish
Copy link
Contributor

Using ServerAliveObserver alone (no client heartbeat), with no SSL, server network inactivity is not detected.

In this case, I fixed this by changing emptyBuffer() in Observer/AbstractBeats.php to call onPotentialConnectionStateActivity(), instead of onServerActivity() which refreshed lastbeat.

Nestorfish added a commit to Nestorfish/stomp-php that referenced this issue Oct 23, 2020
When no data is available, we should not update server activity timestamp.
Instead, ask if something is going wrong.
Fixes stomp-php#148
Due to stomp-php/stomp-php@3f35438
Nestorfish added a commit to Nestorfish/stomp-php that referenced this issue Oct 25, 2020
When no data is available, we should not update server activity timestamp.
Instead, ask if something is going wrong.
Fixes stomp-php#148
Due to stomp-php/stomp-php@3f35438
Nestorfish added a commit to Nestorfish/stomp-php that referenced this issue Oct 25, 2020
When no data is available, we should not update server activity timestamp.
Instead, ask if something is going wrong.
Fixes stomp-php#148
Due to stomp-php/stomp-php@3f35438
@marcuswinkler
Copy link

I've just spent some time debugging this issue and I've come to the same conlusion. An emptyBuffer should not count as server activity. It is called when the read timeout expires with no data.

Currently, the heatbeat timer is reset on every emptyBuffer. This prevents the detection of dead tcp connections. Can easily be confirmed by using firewall rules to drop packets between client and server.

jmglsn pushed a commit that referenced this issue Jan 15, 2021
When no data is available, we should not update server activity timestamp.
Instead, ask if something is going wrong.
Fixes #148
Due to 3f35438
@c-leroy
Copy link

c-leroy commented Jan 15, 2021

Thanks!

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 a pull request may close this issue.

3 participants