#33152: Document the fact that a DB connection can be closed mid-request when a
HTTP client disconnects prematurely
-----------------------------------------+------------------------
               Reporter:  Rich           |          Owner:  nobody
                   Type:  Uncategorized  |         Status:  new
              Component:  Documentation  |        Version:  3.2
               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              |
-----------------------------------------+------------------------
 I've described and diagnosed an issue that has caused me headaches for
 some weeks here:

 https://forum.djangoproject.com/t/db-connection-closed-by-uwsgi-in-the-
 middle-of-handling-a-request/9875

 This took a lot of effort to investigate, and I'd like to avoid others
 having to do the same.

 I think the official doc needs to explain that a HTTP response can be
 closed **DURING** the handling of a request - when this happens, seemingly
 random django.db.utils.InterfaceErrors can be thrown.

 These are very difficult to debug because of the way the
 HttpResponse.close() code has run asynchronously and invisibly.

 It may be that the Django code could also benefit from some changes...the
 HTTP client closing the connection early is after all within the scope of
 'normal' behaviour - right now quite what happens depends on whether a
 transaction is in effect or not, as well as other, essentially arbitrary
 settings. Some sort of normalised behaviour would be great, but I don't
 see how to implement it without setting some sort of global flag on close
 which is regularly checked somewhere...

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33152>
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/053.ca1430609f92b523a1410fbc1aa002bb%40djangoproject.com.

Reply via email to