After a Client / Websocket connection is established, everything runs fine until it’s time to restart the server. I shut down the server using supervisorctl and it hangs for about 10 seconds. When I start it up again, I get this error:
OSError: [Errno 98] Address already in use. I use
ps to verify that my server is still running (it is). Additionally, if I refresh my websocket page a bunch of times it locks up.
Edit: Another related issue is that if a browser tab is refreshed a bunch of times, the entire site will lock up.
In this case when the handler wrapped by
@app.websocket() is completed (after the client connection is closed), the typical middleware isn’t run, and therefore the database connection is never returned to the pool.
These issues are exacerbated by having a low