You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
uwsgi_response_write_body_do(): Broken pipe [core/writer.c line 419] during GET /output (127.0.0.1)
or
uwsgi_websockets_recv_pkt(): Connection reset by peer [core/websockets.c line 194] during GET /output (127.0.0.1)
or
uwsgi_response_write_body_do(): Protocol wrong type for socket [core/writer.c line 419] during GET /output (127.0.0.1)
The above listed errors seem to only occur for process that require a long time to compute. Weirdly, I get different errors when I simply re-run the same request.
This is the code (exemplified) that I'm running on server (the code itself runs without error):
fromflaskimportFlaskfromflask.ext.uwsgi_websocketimportGeventWebSocketapp=Flask('myApp', static_folder=cfg.CLIENT_DIR_LOCATION, static_url_path='')
ws=GeventWebSocket(app)
@ws.route('/output')defrun_job(ws):
whileTrue:
message=ws.receive()
ifmessage:
send_data=json.loads(message)
data=send_data['data']
# Then I run some code in a loop and return the outputforiindata:
output=iws.send(json.dumps({
'event': 'output',
'data': output
}))
And I run the app as follows:
app.run(debug=True, port=8000, gevent=100)
How can I prevent this from happening?
The text was updated successfully, but these errors were encountered:
I was in the meanwhile able to solve the uwsgi_response_write_body_do() problem. This was somehow related to my client side (ngWebsocket) disconnecting. Why the client disconnected is not clear to me, however.
Worth mentioning could be that I'm calling subprocess32 with Popen at # Then I run some code in a loop and return the output and it seems that the errors occur when processes take longer to compute.
Sometimes I get the following errors:
or
or
The above listed errors seem to only occur for process that require a long time to compute. Weirdly, I get different errors when I simply re-run the same request.
This is the code (exemplified) that I'm running on server (the code itself runs without error):
And I run the app as follows:
How can I prevent this from happening?
The text was updated successfully, but these errors were encountered: