mirror of
https://github.com/django/django.git
synced 2025-04-17 05:44:38 +00:00
Previously, the `django.db.close_old_connections` handler for `request_started` and `request_finished` would incorrectly close any connection within a `transaction.atomic` block (such as the one automatically used by `django.db.TestCase`), leading to `InterfaceError: connection already closed`. The test client and many of our tests have been working around this bug by manually suppressing the `close_old_connections` handler, but the workarounds are incomplete and the bug still affects other projects. Fix the bug and remove the workarounds. Signed-off-by: Anders Kaseorg <andersk@mit.edu>