Commit bb50e969 authored by Guido van Rossum's avatar Guido van Rossum

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.
parent 1441bcef
...@@ -68,11 +68,14 @@ def main(args): ...@@ -68,11 +68,14 @@ def main(args):
t = ZEOTestServer(('', test_port), storage) t = ZEOTestServer(('', test_port), storage)
addr = ('', zeo_port) addr = ('', zeo_port)
serv = ZEO.StorageServer.StorageServer(addr, {'1': storage}, ro_svr) serv = ZEO.StorageServer.StorageServer(addr, {'1': storage}, ro_svr)
import zLOG asyncore.loop()
label = "winserver:%d" % os.getpid() # XXX The code below is evil because it can cause deadlocks in zrpc.
while asyncore.socket_map: # (To fix it, calling ThreadedAsync._start_loop() might help.)
zLOG.LOG(label, zLOG.DEBUG, "map: %r" % asyncore.socket_map) ## import zLOG
asyncore.poll(30.0) ## 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__": if __name__ == "__main__":
import sys import sys
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment