Temporary connections not released

Bug #143305 reported by Dieter Maurer
2
Affects Status Importance Assigned to Milestone
ZODB
Won't Fix
Medium
Unassigned

Bug Description

Temporary ZODB connections are never released.

The bug stems from 2 points:

    * the "cc.close()" in "DB.DB.invalidate" closes the
      connection but cycles involving the cache prevent
      the connection from being garbage collected

    * "DB.DB.close" forgets about temporary connections

Both bugs might disappear with Zope 2.8, if then the
cache participates in cyclic garbage collection.
*However* I am not sure! The cyclic garbage collector
cannot collect cycles involving objects with "__del__" methods
and the complex cycle formed between the connection and its cache
might contain such objects (altough persistent objects should
not have "__del__" methods).
Thus, it is probably better to not rely on the cyclic collector.

Tags: bug database
Revision history for this message
Tim Peters (tim-one) wrote :

If "temporary connection" means one obtained by passing temporary=True to DB.open(), that argument was deprecated (and ignored) starting in ZODB 3.4 (3.4 has no inherent limit on the # of open connections, so the concept of a "temporary" connection stopped making much sense). I've opened hundreds of thousands of connections in stress programs there and never bothered to close them -- they do go away when they're no longer strongly referenced ("strongly" means that DB and transaction managers in 3.4 hold only weak references to connections).

The connection management code in 3.2 is more complicated and delicate. If you have a patch that works for you, I'll try to get into the next ZODB 3.2 bugfix release (assuming there is another one -- my best guess is yes, there will be).

Revision history for this message
Hanno Schlichting (hannosch) wrote :

Sounds like this has been resolved with ZODB 3.2+

affects: zope2 → zodb
Changed in zodb:
status: New → Incomplete
Revision history for this message
Jim Fulton (jim-zope) wrote :

There aren't temporary connections any more. :)

Changed in zodb:
status: Incomplete → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.