Closed haoming29 closed 11 months ago
Did you enable pings on your flask-sock server? The pings can be sent every 25 seconds or so to prevent gunicorn from timing out.
Hi, I didn't turn on pings but even if I did and kept the socket sending messages, gunicorn worker still exits after 30s.
I figured out that I didn't set the number of threads in gunicorn configuration. Sorry, I should read the documentation more carefully.
Hi,
I'm using both flask-sock and websocket-client to set up a reverse proxy of WebSocket with Flask. It works fine on the development server. However, in the production server with Gunicorn, the WebSocket connection gets cut off after 30s, which is the timeout for Gunicorn worker. Any thoughts on why this happens? Is it because
thread.join()
blocks the response of flask-sock? Thanks.The error stack trace is as follows:
This is the code for setting up the reverse proxy: