-
-
Notifications
You must be signed in to change notification settings - Fork 527
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
Error on switching to new asyncio #1566
Comments
Extra debug:
By adding the following:
|
Looks like this line where the trailing 00 is lost could be the cause: |
Another example where the data is not returned by the pong, I assume due to a network error:
|
Thank you for providing the debug logs. That makes it a lot easier. Your server (websockets) sends a ping with a random binary payload; the client is expected to echo it as is; but it doesn't, as you can see in the debug logs. When I say "is expected", it's a "MUST" in the RFC (https://datatracker.ietf.org/doc/html/rfc6455#section-5.5.2). Arguably, his is a bug in the client. |
From the perspective of websockets there are two options:
The problem isn't super frequent, which is why I didn't really consider option 2 until now. |
Thanks for the reply, interestingly the error doesn't occur with the legacy implementation with the same client, was number 2 the previous approach? Could the scenarios above occur due to a flaky network connection rather than poor client implementation? Is there a 3rd option to remove the pong future gracefully if it isn't received/matched before the next pong receipt as per:
|
I assume the above could be achieved by moving:
Into the if statement:
|
No - websockets runs over TCP and TCP guarantees that there's no gap in the data stream. |
I'm not 100% sure how you end up in this situation but I'm relatively confident that the change that I just made fixed it. Would you be able to test it? You can just patch websockets like this: 197b3ec#diff-76885032aeb05335d0dc3238fcc783c2af021b1b13d46b3b0401d64956912aa8L753-R754 |
Thanks, will test but the patch looks good to me. |
Cool, thank you for reporting the bug! |
Been running patch for 12h with no issues |
Hi,
I need to do a bit more debugging but is this error expected when switching to the new asyncio from the legacy implementation?
Thanks
It appears to be due to trying to process incoming 0 byte ping/pongs:
The text was updated successfully, but these errors were encountered: