Repository navigation
EventHub: Don't report lost connection while server is busy - #379
Merged
Merged
Conversation
Server sends heartbeat only when it did not publish any other message for 2 seconds, so while busy a client could receive nothing for longer than the receive timeout and consider the connection lost. Ping the server after 5 seconds without any frame and consider the connection lost only when nothing, not even pong, arrived for 15 seconds. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog Description
EventHubno longer reports lost connection while the server is busy but fine. When nothing arrives on the websocket for 5s the client pings the server. Connection is considered lost only when nothing, not even the pong, arrives for 15s.Same change as ynput/ayon-core#2292, for ynput/ayon-core#2291.
Additional info
Server sends heartbeat only when nothing else was published for 2s, and other messages only to clients subscribed to their topic. So a client could receive nothing for a long time. This works with already deployed servers. Server side fix: ynput/ayon-backend#1245.
websocket-clientanswers them with pong on its own.connection.opened, because they don't tell if auth succeeded. Known limitation: after a real reconnect to an unfixed server under continuous load,connection.openedis reported only once the load drops.Testing notes:
pytest tests/test_event_hub_ping.py tests/test_event_hub_lifecycle.py(no server needed).connection.closedevent.docker pause <server container>).connection.closedafter ~15s,connection.openedafter unpause.