Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node.py: Allow custom pid wait timeout #743

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions ccmlib/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
logger = logging.getLogger(__name__)

NODE_WAIT_TIMEOUT_IN_SECS = 90
DEFAULT_UPDATE_PID_TIMEOUT_IN_SECS = int(os.environ.get('CCM_UPDATE_PID_DEFAULT_TIMEOUT', 30))

class Status():
UNINITIALIZED = "UNINITIALIZED"
Expand Down Expand Up @@ -2070,8 +2071,9 @@ def _update_pid(self, process):

start = time.time()
while not (os.path.isfile(pidfile) and os.stat(pidfile).st_size > 0):
if (time.time() - start > 30.0):
common.error("Timed out waiting for pidfile to be filled (current time is {})".format(datetime.now()))
if time.time() - start > DEFAULT_UPDATE_PID_TIMEOUT_IN_SECS:
common.error("Timed out waiting for pidfile to be filled (timeout is {}, current time is {})"
.format(DEFAULT_UPDATE_PID_TIMEOUT_IN_SECS, datetime.now()))
break
else:
time.sleep(0.1)
Expand Down