[Zodb-checkins] CVS: ZODB3/ZEO/tests - winserver.py:1.11

Guido van Rossum guido@python.org
Tue, 1 Oct 2002 14:13:10 -0400


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

Modified Files:
	winserver.py 
Log Message:
Use asyncore.loop() rather than an emulation.  The emulation caused
the server to take the "async=0" path which could cause recursive
calls to message_input() or message_output(), which would hang due to
the input/output locks.


=== ZODB3/ZEO/tests/winserver.py 1.10 => 1.11 ===
--- ZODB3/ZEO/tests/winserver.py:1.10	Thu Sep 26 12:13:45 2002
+++ ZODB3/ZEO/tests/winserver.py	Tue Oct  1 14:13:10 2002
@@ -68,11 +68,14 @@
     t = ZEOTestServer(('', test_port), storage)
     addr = ('', zeo_port)
     serv = ZEO.StorageServer.StorageServer(addr, {'1': storage}, ro_svr)
-    import zLOG
-    label = "winserver:%d" % os.getpid()
-    while asyncore.socket_map:
-        zLOG.LOG(label, zLOG.DEBUG, "map: %r" % asyncore.socket_map)
-	asyncore.poll(30.0)
+    asyncore.loop()
+    # XXX The code below is evil because it can cause deadlocks in zrpc.
+    # (To fix it, calling ThreadedAsync._start_loop() might help.)
+##    import zLOG
+##    label = "winserver:%d" % os.getpid()
+##    while asyncore.socket_map:
+##        zLOG.LOG(label, zLOG.DEBUG, "map: %r" % asyncore.socket_map)
+##        asyncore.poll(30.0)
 
 if __name__ == "__main__":
     import sys