#15802: Django stops functioning when the database (PostgreSQL) closes the
connection
-------------------------------------+-------------------------------------
     Reporter:  Rick.van.Hattem@…    |                    Owner:  aaugustin
         Type:  Bug                  |                   Status:  assigned
    Component:  Database layer       |                  Version:  1.6
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  database, postgres,  |             Triage Stage:  Accepted
  postgresql, connection, closed     |
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  1
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by baumer1122):

 * version:  1.3 => 1.6


Comment:

 I'm seeing this in a Django 1.6.8 project served via uWSGI 2.0.9. The
 exception is:


 {{{
 Traceback (most recent call last):
   File "/srv/myproject/local/lib/python2.7/site-
 packages/django/core/handlers/wsgi.py", line 194, in __call__
     signals.request_started.send(sender=self.__class__)
   File "/srv/myproject/local/lib/python2.7/site-
 packages/django/dispatch/dispatcher.py", line 185, in send
     response = receiver(signal=self, sender=sender, **named)
   File "/srv/myproject/local/lib/python2.7/site-
 packages/django/db/__init__.py", line 91, in close_old_connections
     conn.abort()
   File "/srv/myproject/local/lib/python2.7/site-
 packages/django/db/backends/__init__.py", line 381, in abort
     self.rollback()
   File "/srv/myproject/local/lib/python2.7/site-
 packages/django/db/backends/__init__.py", line 180, in rollback
     self._rollback()
   File "/srv/myproject/local/lib/python2.7/site-
 packages/django/db/backends/__init__.py", line 144, in _rollback
     return self.connection.rollback()
   File "/srv/myproject/local/lib/python2.7/site-
 packages/django/db/utils.py", line 99, in __exit__
     six.reraise(dj_exc_type, dj_exc_value, traceback)
   File "/srv/myproject/local/lib/python2.7/site-
 packages/django/db/backends/__init__.py", line 144, in _rollback
     return self.connection.rollback()
 django.db.utils.InterfaceError: connection already closed
 }}}

 I can reliably replicate it by running `ab` against the app and doing a
 postgresql restart in the middle of it. All future requests fail until the
 uWSGI process is restarted. I tried changing the `lazy-apps` option in
 uWSGI, but the issue persists.

--
Ticket URL: <https://code.djangoproject.com/ticket/15802#comment:36>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/081.e0ed130b3632b798e992aa18f6018fd4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to