[Zodb-checkins] CVS: ZODB3/ZEO - StorageServer.py:1.60
Guido van Rossum
guido@python.org
Mon, 16 Sep 2002 17:08:04 -0400
Update of /cvs-repository/ZODB3/ZEO
In directory cvs.zope.org:/tmp/cvs-serv26916
Modified Files:
StorageServer.py
Log Message:
Fix a subtle bug that caused hard-to-find hangs on Win98 in
checkCommitLock2On{Abort,Commit}. When
ZEOStorage.notifyDisconnected() calls self.tpc_abort(), it is possible
that self.strategy is DelayedCommitStrategy. In that case,
ZEOStorage.tpc_abort() should *not* call self._handle_waiting(),
otherwise there could be two ZEOStorage instances whose strategy is
ImmediateCommitStrategy!
=== ZODB3/ZEO/StorageServer.py 1.59 => 1.60 ===
--- ZODB3/ZEO/StorageServer.py:1.59 Fri Sep 13 17:03:16 2002
+++ ZODB3/ZEO/StorageServer.py Mon Sep 16 17:08:03 2002
@@ -321,10 +321,19 @@
def tpc_abort(self, id):
if not self._check_tid(id):
return
- self.strategy.tpc_abort()
+ strategy = self.strategy
+ strategy.tpc_abort()
self._transaction = None
self.strategy = None
- self._handle_waiting()
+ # When ZEOStorage.notifyDisconnected() calls self.tpc_abort(),
+ # it is possible that self.strategy is DelayedCommitStrategy.
+ # In that case, ZEOStorage.tpc_abort() should *not* call
+ # self._handle_waiting(), otherwise there could be two
+ # ZEOStorage instances whose strategy is
+ # ImmediateCommitStrategy!
+ if isinstance(strategy, ImmediateCommitStrategy):
+ self._handle_waiting()
+ # XXX else, should we remove ourselves from storage._waiting???
# XXX handle new serialnos