We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm getting following error whenever websocket connections are closed.
Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/eventlet/wsgi.py", line 580, in handle_one_response write(b'') File "/usr/local/lib/python3.6/site-packages/eventlet/wsgi.py", line 472, in write raise AssertionError("write() before start_response()") AssertionError: write() before start_response()
More precisely, I'm using Flask-SocketIO with eventlet, with Flask integration of sentry-sdk.
As I see it, the problem occurred by following reason.
In eventlet.websocket, you made a special object called ALREADY_HANDLED which makes special functionalities for websocket handlers
eventlet.websocket
ALREADY_HANDLED
eventlet/eventlet/websocket.py
Lines 136 to 138 in 05d613d
And, in eventlet.wsgi
eventlet.wsgi
The websocket-specific functionalities are handled by type of the return value of WSGI app.
eventlet/eventlet/wsgi.py
Lines 547 to 550 in 05d613d
However, In sentry-sdk, the plugin wraps the WSGI responses (which are iterable objects) with there wrapper called _ScopedResponse.
_ScopedResponse
This is fine, since PEP 3333 specifies the return value of WSGI app just have to be an iterable object.
But it breaks the type check on eventlet.wsgi. So eventlet doesn't finish at the if statement, and emits the above error message.
I think, you may have to use another way to handle websocekt specific features.
The text was updated successfully, but these errors were encountered:
I am encountering the exact same issue. @Hardtack Did you manage to find a workaround?
Sorry, something went wrong.
@jamesharding I already sent a pull request that fix this issue, but it's not be merged yet.
@Hardtack it looks like it was approved. It'd be great if you'll merge it :)
wsgi: websocket ALREADY_HANDLED flag on corolocal
df0bc00
#543
Successfully merging a pull request may close this issue.
I'm getting following error whenever websocket connections are closed.
More precisely, I'm using Flask-SocketIO with eventlet, with Flask integration of sentry-sdk.
As I see it, the problem occurred by following reason.
In
eventlet.websocket
, you made a special object calledALREADY_HANDLED
which makes special functionalities for websocket handlerseventlet/eventlet/websocket.py
Lines 136 to 138 in 05d613d
And, in
eventlet.wsgi
The websocket-specific functionalities are handled by type of the return value of WSGI app.
eventlet/eventlet/wsgi.py
Lines 547 to 550 in 05d613d
However, In sentry-sdk, the plugin wraps the WSGI responses (which are iterable objects) with there wrapper called
_ScopedResponse
.This is fine, since PEP 3333 specifies the return value of WSGI app just have to be an iterable object.
But it breaks the type check on
eventlet.wsgi
. So eventlet doesn't finish at the if statement, and emits the above error message.I think, you may have to use another way to handle websocekt specific features.
The text was updated successfully, but these errors were encountered: