Commit 87b92f4a authored by Chris McDonough's avatar Chris McDonough

Collector #1350: segfaults under SessionRig stress tester. Since we perform a...

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.
parent 443514cd
...@@ -26,7 +26,7 @@ import traceback ...@@ -26,7 +26,7 @@ import traceback
import Persistence, Acquisition import Persistence, Acquisition
from Acquisition import aq_base from Acquisition import aq_base
from ZODB.POSException import MountedStorageError from ZODB.POSException import MountedStorageError, ConnectionStateError
LOG = getLogger('Zope.ZODBMountPoint') LOG = getLogger('Zope.ZODBMountPoint')
...@@ -203,12 +203,19 @@ class ConnectionPatches: ...@@ -203,12 +203,19 @@ class ConnectionPatches:
# XXX maybe we ought to call the close callbacks. # XXX maybe we ought to call the close callbacks.
conn._storage = conn._tmp = conn.new_oid = conn._opened = None conn._storage = conn._tmp = conn.new_oid = conn._opened = None
conn._debug_info = () 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 # The mounted connection keeps a reference to
# its database, but nothing else. # its database, but nothing else.
# Note that mounted connections can not operate # Note that mounted connections can not operate
# independently, so don't use _closeConnection() to # independently, so don't use _closeConnection() to
# return them to the pool. Only the root connection # return them to the pool. Only the root connection
# should be returned. # should be returned.
# Close this connection only after the mounted connections # Close this connection only after the mounted connections
# have been closed. Otherwise, this connection gets returned # have been closed. Otherwise, this connection gets returned
# to the pool too early and another thread might use this # to the pool too early and another thread might use this
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment