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

Comment (by anonymous):

 I'm running django/postgres on an unreliable infrastructur (All network is
 in principle unreliable!). Of course I am hitting this problem too. Please
 help me understand the state of the issue and possible workarounds.

 === State ===

  * Changeset [16708] has been committed to the trunk on 29/Aug/11 and
 provides an improvement but no complete fix
  * Django 1.3.1 has been released 9/Sep/11
  * Django 1.3.1 does NOT contain the fix. What a pity!
  * The second patch completes the fix but it is not committed anywhere

  * Postgres & Django without workaround or fix == no good idea

 === Workarounds ===

  * Apply the attached patches to my production systems (Somehow I don't
 like this!)
  * Ease the pain by adding a connection pool on each postgres client and
 connect locally

 === Solutions ===

  * Convince the psycopg2 guys that their interpretation of pep-0249 is
 wrong as it seems that the mysql guys interpreted the following different
 (from pep-0249):
          .close()

             Close the connection now (rather than whenever !__del!__ is
             called).  The connection will be unusable from this point
             forward; an Error (or subclass) exception will be raised
             if any operation is attempted with the connection.

  * Wait for Django 1.4

 Is patching my installation the preferred solution at the moment? Is there
 some other workaround?

 What is the 'real' solution to this issue? Should django just deal with
 the different behavior? Should psycopg2 change its behavior?

 Since many people seem to have problems with that behavior(just google
 '!InterfaceError: connection already closed') it seems to be a common
 understanding that closing a closed connection should not raise an
 exception. Therefore I'd say we should open a ticket at psycopg2's issue
 tracker.

 Do you agree? Or did I misunderstand the issue and its background?

 -

 Sebastian

-- 
Ticket URL: <https://code.djangoproject.com/ticket/15802#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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to