[Django] #34006: close_old_connections unconditionally closes connections inside atomic blocks if default autocommit = 1

4 views
Skip to first unread message

Django

unread,
Sep 12, 2022, 7:11:44 AM9/12/22
to django-...@googlegroups.com
#34006: close_old_connections unconditionally closes connections inside atomic
blocks if default autocommit = 1
-------------------------------------+-------------------------------------
Reporter: Didier | Owner: nobody
Frick |
Type: Bug | Status: new
Component: Database | Version:
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
This problem has already been reported in
https://code.djangoproject.com/ticket/30448 and the fix is in
https://github.com/django/django/pull/11769 but somehow never made it to
the repo.

Currently, without this patch, IIUC, if default autocommit is on, then
close_old_connections will yank the connection from underneath any code
that happens to be running inside an atomic block at the time (because
atomic blocks set autocommit to 0, which is different from the default).

The fix is to merge https://github.com/django/django/pull/11769

--
Ticket URL: <https://code.djangoproject.com/ticket/34006>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Reply all
Reply to author
Forward
0 new messages