#34752: ASGI http.disconnect not handled for streaming responses
-----------------------------------------+------------------------
Reporter: Sam Toyer | Owner: nobody
Type: Bug | Status: new
Component: HTTP handling | Version: dev
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
The fix to #33738 (ticket) correctly handles HTTP disconnects before a
view exits (i.e. returns a response object), but does not handle
disconnects between the time when the view returns and the time when the
response actually finishes. This is a particular problem for long-lived
`StreamingHttpResponse`s (e.g. for SSE).
The issue can be solved by extending the original cancellation/disconnect-
handling logic to also cover `AsgiHandler.send_response()`. Example tests
and a fix are in this commit:
https://github.com/qxcv/django/commit/ed2f9ad03a3abbc636fd5fa590d69ba36571c158
I'm happy to file a PR if this is wanted upstream.
--
Ticket URL: <https://code.djangoproject.com/ticket/34752>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/01070189a557cf50-d22255dc-50f0-4bc5-8c18-dc2b9d433d84-000000%40eu-central-1.amazonses.com.