#19519: Django fails to close db connections at end of request-response cycle -------------------------------------+------------------------------------- Reporter: amosonn@… | Owner: aaugustin Type: Bug | Status: assigned Component: Database layer | Version: master (models, ORM) | Resolution: Severity: Release blocker | Triage Stage: Ready for Keywords: connection, | checkin managment, closing, mysql, | Needs documentation: 0 innodb, signal, generator | Patch needs improvement: 0 Has patch: 1 | UI/UX: 0 Needs tests: 0 | Easy pickings: 0 | -------------------------------------+------------------------------------- Changes (by aaugustin):
* needs_tests: 1 => 0 * stage: Accepted => Ready for checkin Comment: This isn't testable within Django's test framework because the test client explicitly disables closing the database connection at the end of each request (since #8138). I've used Florian's test project to validate manually that the pull request fixes the issue. Per PEP 3333, "the close() method requirement is to support resource release by the application". Currently, Django uses the `request_finished` signal to close the connections to the databases and caches. That's exactly the purpose of `close()`, and therefore I think it's a good idea to send the signal from there. -- Ticket URL: <https://code.djangoproject.com/ticket/19519#comment:13> 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.