Flask / Werkzeug - sockets stuck in CLOSE_WAIT

你说的曾经没有我的故事 提交于 2019-12-11 09:49:08

问题


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?

来源:https://stackoverflow.com/questions/31403261/flask-werkzeug-sockets-stuck-in-close-wait

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!