Skip to content

websocket_ping: fix ping interval with non-zero timeout and improve docs #3513

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

Open
wants to merge 1 commit into
base: branch6.5
Choose a base branch
from

Conversation

oliver-sanders
Copy link
Contributor

  • Fix a bug that caused the ping interval to be less frequent than configured.
  • Fix erroneous documentation of the websocket_ping_timeout default and clarify units for the ping interval.

…ocs.

* Fix a bug that caused the ping interval to be less frequent than
  configured.
* Fix erroneous documentation of the websocket_ping_timeout default and
  clarify units for the ping interval.
@@ -1371,7 +1371,7 @@ async def periodic_ping(self) -> None:
return

# wait until the next scheduled ping
await asyncio.sleep(IOLoop.current().time() - ping_time + interval)
await asyncio.sleep(ping_time + interval - IOLoop.current().time())
Copy link
Contributor Author

@oliver-sanders oliver-sanders Jun 19, 2025

Choose a reason for hiding this comment

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

Well this is embarrassing, the calculation of the next ping time was wrong, my apologies.

This caused pings to be less frequent than configured.

@oliver-sanders oliver-sanders changed the base branch from master to branch6.5 June 19, 2025 11:00
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.

1 participant