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

[Bug] WebSocket server does not send pings, client disconnects and reconnects periodically #459

Closed
andrewazores opened this issue May 14, 2024 · 0 comments · Fixed by #460
Assignees
Labels
bug Something isn't working

Comments

@andrewazores
Copy link
Member

Current Behavior

After establishing a WebSocket notification connection between the Cryostat server and web-client UI the connection is left idle, unless some activity happens and triggers the emission of a notification event.

If the connection is idle for long enough it will be closed (by the browser?):

image

image

The web-client knows to retry opening a WebSocket connection when it is disconnected, so the connection is re-established almost immediately.

Expected Behavior

WebSocket ping frames should be sent periodically so that the connection is kept alive and the web-client application code does not need to attempt to reconnect.

Older Cryostat versions did this every 5 seconds: https://github.com/cryostatio/cryostat/blob/ed1fcbd31d8e2d759b85397a29414959c9e40df9/src/main/java/io/cryostat/messaging/MessagingServer.java#L184 . This is probably much faster than it needs to be: https://stackoverflow.com/questions/14576298/how-to-decide-the-ping-interval-for-websocket-connection

Steps To Reproduce

No response

Environment

No response

Anything else?

No response

@andrewazores andrewazores added the bug Something isn't working label May 14, 2024
@andrewazores andrewazores self-assigned this May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant