Commit 9d765e8d authored by Jim Fulton's avatar Jim Fulton

Added a timeout argument to the ZEO4 server (copy)

It turns out the ZEO4 server doesn't shutdown cleanly in tests without
a shorter timeout (like the one I added for ZEO5).

For now, this is just in the copy used in the ZEO5 tests.  If I have
to updatre the copy at some point (hopefully not), then I'll add this
to ZEO4 proper.
parent 7cb60051
...@@ -1153,9 +1153,9 @@ class StorageServer: ...@@ -1153,9 +1153,9 @@ class StorageServer:
return latest_tid, list(oids) return latest_tid, list(oids)
def loop(self): def loop(self, timeout=30):
try: try:
asyncore.loop(map=self.socket_map) asyncore.loop(timeout, map=self.socket_map)
except Exception: except Exception:
if not self.__closed: if not self.__closed:
raise # Unexpected exc raise # Unexpected exc
......
...@@ -134,8 +134,7 @@ def runner(config, qin, qout, timeout=None, ...@@ -134,8 +134,7 @@ def runner(config, qin, qout, timeout=None,
qout.put(server.server.acceptor.addr) qout.put(server.server.acceptor.addr)
logger.debug('ADDRESS SENT') logger.debug('ADDRESS SENT')
thread = threading.Thread( thread = threading.Thread(
target=server.server.loop, target=server.server.loop, kwargs=dict(timeout=.2),
kwargs={} if ZEO4_SERVER else dict(timeout=.2),
name = None if name is None else name + '-server', name = None if name is None else name + '-server',
) )
thread.setDaemon(True) thread.setDaemon(True)
......
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