[Zodb-checkins] SVN: ZODB/trunk/src/ZEO/ServerStub.py Time out waiting for protocol handshake. Otherwise, we sometmes see

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


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

Changed:
  U   ZODB/trunk/src/ZEO/ServerStub.py

-=-
Modified: ZODB/trunk/src/ZEO/ServerStub.py
===================================================================
--- ZODB/trunk/src/ZEO/ServerStub.py	2009-10-11 14:41:46 UTC (rev 105014)
+++ ZODB/trunk/src/ZEO/ServerStub.py	2009-10-11 17:42:41 UTC (rev 105015)
@@ -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 Zodb-checkins mailing list