[Zodb-checkins] CVS: ZODB3/ZEO - StorageServer.py:1.74.2.3.2.2

Jeremy Hylton jeremy@zope.com
Fri, 1 Nov 2002 18:46:19 -0500


Update of /cvs-repository/ZODB3/ZEO
In directory cvs.zope.org:/tmp/cvs-serv31318

Modified Files:
      Tag: ZODB3-deadlock-debug-branch
	StorageServer.py 
Log Message:
Call timeout.begin() at the right time.

Don't call begin() in vote(), because the client may have been put on
the waiting list.  Instead, call begin() when we are sure that the
storage's tpc_vote() has been called.


=== ZODB3/ZEO/StorageServer.py 1.74.2.3.2.1 => 1.74.2.3.2.2 ===
--- ZODB3/ZEO/StorageServer.py:1.74.2.3.2.1	Thu Oct 31 16:02:18 2002
+++ ZODB3/ZEO/StorageServer.py	Fri Nov  1 18:46:18 2002
@@ -443,9 +443,7 @@
 
     def vote(self, id):
         self.check_tid(id, exc=StorageTransactionError)
-        r = self.strategy.tpc_vote()
-        self.timeout.begin()
-        return r
+        return self.strategy.tpc_vote()
 
     def abortVersion(self, src, id):
         self.check_tid(id, exc=StorageTransactionError)
@@ -477,6 +475,7 @@
                      "Clients waiting: %d." % len(self.storage._waiting))
             return d
         else:
+            self.timeout.begin()
             return self.restart()
 
     def dontwait(self):
@@ -512,6 +511,7 @@
         assert isinstance(old_strategy, DelayedCommitStrategy)
         self.strategy = ImmediateCommitStrategy(self.storage,
                                                 self.client)
+        self.timeout.begin()
         resp = old_strategy.restart(self.strategy)
         if delay is not None:
             delay.reply(resp)