This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
db session middleware with custom exception middleware raises AnyIO EndOfSteam when client closes early #4544
Closed
9 tasks done
Labels
First Check
Commit to Help
Example Code
Description
We are using the db session middleware exactly as described here in combination with a custom http exception middleware. When a client is disconnecting from us early we get spammed with a bunch of
No response returned
errors from starlette.How to reproduce:
Open browser and call the endpoint
/
Close the window before the request completes.
You will see that AnyIO raises a
EndOfStream
error which ends up being propogated as aRuntime Error
with the message asNo response returned
Operating System
Linux, macOS
Operating System Details
No response
FastAPI Version
0.73.0
Python Version
Python 3.9.6
Additional Context
SQLAlchemy==1.4.31
The text was updated successfully, but these errors were encountered: