[Zodb-checkins] CVS: Zope/lib/python/ZEO - ClientStorage.py:1.106.4.7

Jeremy Hylton jeremy at zope.com
Fri Oct 3 15:29:00 EDT 2003


Update of /cvs-repository/Zope/lib/python/ZEO
In directory cvs.zope.org:/tmp/cvs-serv29504

Modified Files:
      Tag: Zope-2_7-branch
	ClientStorage.py 
Log Message:
Wasn't threading through deadline on the synchronous case.

And the synchronous case is the one we care about for running the
tests.


=== Zope/lib/python/ZEO/ClientStorage.py 1.106.4.6 => 1.106.4.7 ===
--- Zope/lib/python/ZEO/ClientStorage.py:1.106.4.6	Mon Sep 29 11:19:41 2003
+++ Zope/lib/python/ZEO/ClientStorage.py	Fri Oct  3 15:28:59 2003
@@ -319,6 +319,9 @@
     def _wait(self, timeout=None):
         if timeout is not None:
             deadline = time.time() + timeout
+            log2(BLATHER, "Setting deadline to %f" % deadline)
+        else:
+            deadline = None
         # Wait for a connection to be established.
         self._rpc_mgr.connect(sync=1)
         # When a synchronous connect() call returns, there is
@@ -336,13 +339,16 @@
                     break
                 log2(INFO, "Waiting for cache verification to finish")
         else:
-            self._wait_sync()
+            self._wait_sync(deadline)
 
-    def _wait_sync(self):
+    def _wait_sync(self, deadline):
         # If there is no mainloop running, this code needs
         # to call poll() to cause asyncore to handle events.
         while 1:
             if self._ready.isSet():
+                break
+            if deadline and time.time() > deadline:
+                log2(PROBLEM, "Timed out waiting for connection")
                 break
             log2(INFO, "Waiting for cache verification to finish")
             if self._connection is None:




More information about the Zodb-checkins mailing list