Skip to content

Commit

Permalink
scylla_node: _update_jmx_pid: print Timed out message only if wait=True
Browse files Browse the repository at this point in the history
We get benign Timed out messages when stopping a node before
scylla-jmx started running and we explicitly pass wait=False
for this reason.

Signed-off-by: Benny Halevy <[email protected]>
  • Loading branch information
bhalevy committed Jan 21, 2020
1 parent b01b9c0 commit 571772a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions ccmlib/scylla_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,12 +549,14 @@ def _update_jmx_pid(self, wait=True):

start = time.time()
while not (os.path.isfile(pidfile) and os.stat(pidfile).st_size > 0):
if time.time() - start > 30.0 or not wait:
print_("Timed out waiting for pidfile {} to be filled (after {} seconds): File {} size={}".format(
pidfile,
0 if not wait else time.time() - start,
'exists' if os.path.isfile(pidfile) else 'does not exist' if not os.path.exists(pidfile) else 'is not a file',
os.stat(pidfile).st_size if os.path.exists(pidfile) else -1))
elapsed = time.time() - start
if elapsed > 30.0 or not wait:
if wait:
print_("Timed out waiting for pidfile {} to be filled (after {} seconds): File {} size={}".format(
pidfile,
elapsed,
'exists' if os.path.isfile(pidfile) else 'does not exist' if not os.path.exists(pidfile) else 'is not a file',
os.stat(pidfile).st_size if os.path.exists(pidfile) else -1))
break
else:
time.sleep(0.1)
Expand Down

0 comments on commit 571772a

Please sign in to comment.