mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-03-11 06:43:54 +00:00
Wait up to 60s for node start; improve messaging; look for errors
This commit is contained in:
parent
04b34b6fd2
commit
fd90346c88
@ -123,14 +123,25 @@ def start(config):
|
|||||||
f.seek(starting_offset)
|
f.seek(starting_offset)
|
||||||
|
|
||||||
collected = u''
|
collected = u''
|
||||||
start = time.time()
|
overall_start = time.time()
|
||||||
while time.time() - start < 5:
|
while time.time() - overall_start < 60:
|
||||||
collected += f.read()
|
this_start = time.time()
|
||||||
if magic_string in collected:
|
while time.time() - this_start < 5:
|
||||||
if not config.parent['quiet']:
|
collected += f.read()
|
||||||
print >>out, "Node has started successfully"
|
if magic_string in collected:
|
||||||
return 0
|
if not config.parent['quiet']:
|
||||||
time.sleep(0.1)
|
print >>out, "Node has started successfully"
|
||||||
|
return 0
|
||||||
|
if 'Traceback ' in collected:
|
||||||
|
print >>err, "Error starting node; see '{}' for more:\n\n{}".format(
|
||||||
|
log_fname,
|
||||||
|
collected,
|
||||||
|
)
|
||||||
|
return 1
|
||||||
|
time.sleep(0.1)
|
||||||
|
print >>out, "Still waiting up to {}s for node startup".format(
|
||||||
|
60 - int(time.time() - overall_start)
|
||||||
|
)
|
||||||
|
|
||||||
print >>out, "Something has gone wrong starting the node."
|
print >>out, "Something has gone wrong starting the node."
|
||||||
print >>out, "Logs are available in '{}'".format(log_fname)
|
print >>out, "Logs are available in '{}'".format(log_fname)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user