[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/ZODBMountPoint/Mount.py Collector #1350: segfaults under SessionRig stress tester. Since we perform a unfortunate monkey-patch in here to ZODB's Connection class, and in doing so we override the "close" method of that class, we need to do all of the things that ZODB 3.3's "close" method does, which includes unregistering a synchronizer.

Chris McDonough chrism at plope.com
Sun Oct 10 10:20:20 EDT 2004


Log message for revision 27908:
  Collector #1350: segfaults under SessionRig stress tester.  Since we perform a unfortunate monkey-patch in here to ZODB's Connection class, and in doing so we override the "close" method of that class, we need to do all of the things that ZODB 3.3's "close" method does, which includes unregistering a synchronizer.
  


Changed:
  U   Zope/trunk/lib/python/Products/ZODBMountPoint/Mount.py


-=-
Modified: Zope/trunk/lib/python/Products/ZODBMountPoint/Mount.py
===================================================================
--- Zope/trunk/lib/python/Products/ZODBMountPoint/Mount.py	2004-10-10 14:18:14 UTC (rev 27907)
+++ Zope/trunk/lib/python/Products/ZODBMountPoint/Mount.py	2004-10-10 14:20:20 UTC (rev 27908)
@@ -26,7 +26,7 @@
 
 import Persistence, Acquisition
 from Acquisition import aq_base
-from ZODB.POSException import MountedStorageError
+from ZODB.POSException import MountedStorageError, ConnectionStateError
 
 
 LOG = getLogger('Zope.ZODBMountPoint')
@@ -203,12 +203,19 @@
                 # XXX maybe we ought to call the close callbacks.
                 conn._storage = conn._tmp = conn.new_oid = conn._opened = None
                 conn._debug_info = ()
+
+                # collector #1350: ensure that the connection is unregistered
+                # from the transaction manager (XXX API method?)
+                if conn._synch:
+                    conn._txn_mgr.unregisterSynch(conn)
+
                 # The mounted connection keeps a reference to
                 # its database, but nothing else.
                 # Note that mounted connections can not operate
                 # independently, so don't use _closeConnection() to
                 # return them to the pool.  Only the root connection
                 # should be returned.
+
         # Close this connection only after the mounted connections
         # have been closed.  Otherwise, this connection gets returned
         # to the pool too early and another thread might use this



More information about the Zope-Checkins mailing list