#19519: Django fails to close db connections at end of request-response cycle
-------------------------------------+-------------------------------------
     Reporter:  amosonn@…            |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |               Resolution:
     Severity:  Release blocker      |             Triage Stage:  Accepted
     Keywords:  connection,          |      Needs documentation:  0
  managment, closing, mysql,         |  Patch needs improvement:  0
  innodb, signal, generator          |                    UI/UX:  0
    Has patch:  0                    |
  Needs tests:  0                    |
Easy pickings:  0                    |
-------------------------------------+-------------------------------------

Comment (by apollo13):

 Ok, so I attached an initial patch. Anssi provided some valuable feedback:
 He suggested that we only do the .close dance if we are actually working
 with a StreamingResponse to keep the patch backwards-compatible (although
 we don't know if it is backwards-incompatible yet). I somewhat agree with
 that, but on the other hand I'd like to handle both cases in the same way.

 Next question is how to handle streaming responses in the test client.
 Currently they are not consumed at all and Anssi suggested to consume them
 always (probably add a flag later on to prevent consuming them, but that's
 probably not needed for 1.5).

 Last thing: I am still thinking how to test that since the TestClient uses
 it's own WSGI handler which does stuff a bit different (it actually
 disconnects the close_connections receiver before it fires
 request_finished ;)).

 Any thoughts from someone with more knowledge of the WSGI protocol than me
 would be appreciated :)

-- 
Ticket URL: <https://code.djangoproject.com/ticket/19519#comment:8>
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to