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

Jeremy Hylton jeremy@zope.com
Fri, 26 Jul 2002 16:02:02 -0400


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

Modified Files:
	StorageServer.py 
Log Message:
Revise log messages for blocked transactions.

Log message less choppy.

There was an info-level log call when a transaction was blocked, but
not a complementary one when the transaction was resumed.  Added the
latter, so that the log provides a clear record of whether the server
is wedged or working.


=== ZODB3/ZEO/StorageServer.py 1.38 => 1.39 ===
         if self.__storage._transaction:
             d = Delay()
             self.__storage._waiting.append((d, self))
-            self._log("Transaction block waiting for storage. "
+            self._log("Transaction blocked waiting for storage. "
                       "%d clients waiting." % len(self.__storage._waiting))
             return d
         else:
@@ -363,6 +363,12 @@
             delay, zeo_storage = self.__storage._waiting.pop(0)
             if self._restart(zeo_storage, delay):
                 break
+            if self.__storage._waiting:
+                n = len(self.__storage._waiting)
+                self._log("Blocked transaction restarted.  "
+                          "%d clients waiting." % n)
+            else:
+                self._log("Blocked transaction restarted.")
 
     def _restart(self, zeo_storage, delay):
         # call the restart() method on the appropriate server