-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
send_message() race condition #12
Comments
this needs some review of the API and design my quick fix was to loop on bytes_to_send():
However, if there is a high enough rate of Perhaps |
Whoops, I never did file this here, did I? It's mentioned here: python-trio/trio#637 I think the fix is to get rid of the writer task entirely, which would simplify things for other reasons too: #3 |
An earlier version of this library had no writer task, and I thought I was simplifying things by adding one! It should be easy to revert. |
This race condition causes send_message() to return even though message is not sent, and _writer_task() to block even though there is a pending message from wsproto.
send_message():
https://github.com/HyperionGray/trio-websocket/blob/b787bf1a8a026ef1d9ca995d044bc97d42e7f727/trio_websocket/__init__.py#L192-L195
_writer_task():
https://github.com/HyperionGray/trio-websocket/blob/b787bf1a8a026ef1d9ca995d044bc97d42e7f727/trio_websocket/__init__.py#L299-L306
As part of this fix, it would be great to set up pytest and have an explicit test for this case.
The text was updated successfully, but these errors were encountered: