Skip to content

Commit

Permalink
better debugging of server startup.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Fulton committed Jul 7, 2016
1 parent 88c5963 commit 694ff8e
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/ZEO/tests/forker.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def stop_runner(thread, config, qin, qout, stop_timeout=9, pid=None):
def start_zeo_server(storage_conf=None, zeo_conf=None, port=None, keep=False,
path='Data.fs', protocol=None, blob_dir=None,
suicide=True, debug=False,
threaded=False, start_timeout=150, name=None,
threaded=False, start_timeout=33, name=None,
):
"""Start a ZEO server in a separate process.
Expand Down Expand Up @@ -231,7 +231,15 @@ def start_zeo_server(storage_conf=None, zeo_conf=None, port=None, keep=False,
)
thread.daemon = True
thread.start()
addr = qout.get(timeout=start_timeout)
try:
addr = qout.get(timeout=start_timeout)
except Exception:
whine("SERVER FAILED TO START")
if thread.is_alive():
whine("Server thread/process is still running")
elif not threaded:
whine("Exit status", thread.exitcode)
raise

def stop(stop_timeout=99):
stop_runner(thread, tmpfile, qin, qout, stop_timeout)
Expand Down Expand Up @@ -423,3 +431,6 @@ def stop():

return stop

def whine(*message):
print(*message, file=sys.stderr)
sys.stderr.flush()

0 comments on commit 694ff8e

Please sign in to comment.