abersheeran / a2wsgi

Convert WSGI app to ASGI app or ASGI app to WSGI app.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Uvicorn 0.28.0 introduction of new ClientDisconnected exception which impacts WSGIMiddleware on client disconnects

kravnaut opened this issue · comments

We have a few endpoints behind the WSGIMiddleware. We noticed that with uvicorn upgrade to 0.28.0 it introduced a new ClientDisconnected exception that is now getting into the flow. It seems that WSGIMiddleware is not catching it / handling it and the request appears as if it never completed as our outer ASGI middleware is observing.

Repro is to have a flask app behind WSGIMiddleware to do something slow and then make a request and cancel it before the flask endpoint can return a response. We can then observe that the middleware app awaitable is never completing, resources keep piling up.

ah, should have looked at closed issues, seems like 1.10.2 -> 1.10.4 should fix this for us