Heroku sock = backend Server request aborts for a SocketIO application with a jar

I have a flask-socketio application hosted on heroku with the following Procfile:

web: gunicorn --worker-class eventlet hello:app 

Ever since I switched to socketio, the application has been behaving inconsistently. The application used to run for a while, and then POST requests started a timeout.

From last night I keep getting a mistake

 sock=backend at=error code=H18 desc="Server Request Interrupted" method=GET path="/static/js/third-party/browser.js" host=deard.herokuapp.com request_id=725da6af-aa29-4293-a411-2c89977f1d4d fwd="216.165.95.0" dyno=web.1 connect=1ms service=36ms status=503 bytes=13811 

I read the description of the heroku error code, which says: "The backend socket belonging to your web application process was closed before the backend returned an HTTP response."

But I do not know why this will happen.

Any clue on what I should look for will help me debug this.

I could share the code, but its 300 lines is longer, and since I don't know where the error is coming from, I'm not sure it would be useful.

+5
source share
1 answer

This "socket stream error" is raised by Flask when canceling or repeating the same server-side request (flask) that you still find under the computation to display the layout corresponding to the original request.

Thus, it can be relative to the timeout or network error handling on both sides (server / client).

Some kind of question:

How long does the server side request take? How do you handle network and client-side network error exceptions? Is there any timeout on the flask or client side?

It is also possible that a new request is sent before the end of the previous one.

Please share some code regarding request processing.

0
source

Source: https://habr.com/ru/post/1240280/


All Articles