[Checkins] SVN: ZODB/branches/jim-thready-zeo2/src/ZEO/ServerStub.py Time out waiting for protocol handshake. Otherwise, we sometmes see

Jim Fulton jim at zope.com
Sun Oct 11 13:48:43 EDT 2009


Log message for revision 105016:
  Time out waiting for protocol handshake.  Otherwise, we sometmes see
  hangs under extreme conditions.
  

Changed:
  U   ZODB/branches/jim-thready-zeo2/src/ZEO/ServerStub.py

-=-
Modified: ZODB/branches/jim-thready-zeo2/src/ZEO/ServerStub.py
===================================================================
--- ZODB/branches/jim-thready-zeo2/src/ZEO/ServerStub.py	2009-10-11 17:42:41 UTC (rev 105015)
+++ ZODB/branches/jim-thready-zeo2/src/ZEO/ServerStub.py	2009-10-11 17:48:42 UTC (rev 105016)
@@ -13,6 +13,7 @@
 ##############################################################################
 """RPC stubs for interface exported by StorageServer."""
 
+import os
 import time
 
 ##
@@ -368,11 +369,12 @@
     def iterator_gc(self, iids):
         raise NotImplementedError
 
-
 def stub(client, connection):
-
+    start = time.time()
     # Wait until we know what version the other side is using.
     while connection.peer_protocol_version is None:
+        if time.time()-start > 10:
+            raise ValueError("Timeout waiting for protocol handshake")
         time.sleep(0.1)
 
     if connection.peer_protocol_version < 'Z309':



More information about the checkins mailing list