I've run into a situation where an API built on Flask-Restul intermittently becomes non-responsive. Currently it's running from Werkzeug (which I'm aware is for non-production use only) and single threaded. To complicate things a little further this is also all wrapped up inside axscript within another application.
When non-responsive, a significant number of sockets show in the CLOSE_WAIT
so there's something not being handled correctly during a client initiated socket teardown.
As this is running single threaded it appears that the internals of a request handler may be blocking indefinitely preventing other requests from being accepted and ultimately causing the client timeout. However, as the thread is busy this prevents the socket from actually closing.
Does this sounds like a sane assumption based on knowledge other have of the framework? Also, if an unhanded exception is thrown within a request handler, will this always result in a 500 error being returned, or is there some other scenario here I'm missing?