-
-
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
Uncaught LocalProtocolError
(wsproto >= 1.2.0)
#175
Comments
I guess so, but the definition of that exception is quite blurry. If it's a programming error, I wouldn't want it suppressed as ConnectionClosed.
For what it's worth, our app has never hit this exception, running 1000's of instances for years. |
I'm just speculating here since I'm not really deep in the wsproto code, but maybe the "programming error" here refers to calling connection.send despite the connection.state being REMOTE_CLOSING. I think it's not meant to indicate an error in wsproto itself but by trio-websocket doing an operation that is invalid with the websocket state. |
I notice there are only two calls of it's a little troubling that this send-when-closing case isn't exposed by the autobahn test suite, but perhaps it's very timing sensitive. |
And I don't understand this code, explicitly calling send if the state is |
apparently sending CloseConnection is allowed during REMOTE_CLOSING: |
I see, we're running an old wsproto (0.14), but the change of raising LocalProtocolError for a text message is very recent (1.2.0): |
It might be a race condition. When trio-websocket receives a |
LocalProtocolError
LocalProtocolError
(wsproto >= 1.2.0)
For good measure, I'm asking wsproto to clarify connection state change timing. |
autobahn client test hits a LocalProtocolError, but it's a different connection state (
|
Unfortunately, Redefining this close-in-progress case to raise Interestingly, |
send_message() is changed to raise ConnectionClosed when a close handshake is in progress. Previously it would silently ignore the call, which was an oversight, given that ConnectionClosed is defined to cover connections "closed or in the process of closing". Significantly, this fixes send_message() leaking a wsproto exception (LocalProtocolError) with wsproto >= 1.22.0. Fixes #175.
send_message() is changed to raise ConnectionClosed when a close handshake is in progress. Previously it would silently ignore the call, which was an oversight, given that ConnectionClosed is defined to cover connections "closed or in the process of closing". Significantly, this fixes send_message() leaking a wsproto exception (LocalProtocolError) with wsproto >= 1.22.0. Fixes #175.
Hey @belm0. Just wanted to thank you for taking care of this so quickly! |
Hey there, first of all many thanks for providing this great library!
I'm running version 0.9.2 but I think it might be still relevant.
Websocket server had some ongoing maintenance and was dropping connections from time to time. Looks like this lead to the issue seen below. Should this wsproto error maybe be mapped to ConnectionClosed?
The text was updated successfully, but these errors were encountered: