If the client disconnects from a StreamingResponse, the server does not stop the request, but keeps it alive and the stream generator running (which is problematic with an endless live stream or similar).
The problem is. that in Starlette v0.13.2 there was no listener task to cancel the streaming response in case of an early disconnect, which was fixed in this commit. The fix was released in Starlette v0.13.3, but is not yet reflected in FastAPI, because Starlette is pinned to v0.13.2 in the pyproject.toml.
I guess this issue can be closed as soon as FastAPI upgrades Starlette.
If the client disconnects from a
StreamingResponse, the server does not stop the request, but keeps it alive and the stream generator running (which is problematic with an endless live stream or similar).The problem is. that in Starlette v0.13.2 there was no listener task to cancel the streaming response in case of an early disconnect, which was fixed in this commit. The fix was released in Starlette v0.13.3, but is not yet reflected in FastAPI, because Starlette is pinned to v0.13.2 in the pyproject.toml.
I guess this issue can be closed as soon as FastAPI upgrades Starlette.