Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2219)

Unified Diff: masters/master-common-rules.mk

Issue 1808383002: Cause make start to wait for master start. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: masters/master-common-rules.mk
diff --git a/masters/master-common-rules.mk b/masters/master-common-rules.mk
index 73d249aa6998ccf25c0c06eccca290ecca7a102b..a8b72e654c4b338ef119c8dca7894b33327c6d67 100644
--- a/masters/master-common-rules.mk
+++ b/masters/master-common-rules.mk
@@ -63,8 +63,15 @@ ifndef NO_REVISION_AUDIT
|| echo 'Running send_monitoring_event failed, skipping sending events.' \
) 2>&1 | tee -a actions.log
endif
+ # There is a race condition between startup and when twistd.pid is written.
+ # Anyone issuing a second `make start` before the twistd.pid is written will
+ # spawn two masters. This is hopefully unlikely, but a proper solution would
+ # be to use flock (not available on OSX). The critical section contains BOTH
+ # the twistd start and the wait for the twistd.pid.
@echo 'Now running Buildbot master.'
PYTHONPATH=$(PYTHONPATH) python $(SCRIPTS_DIR)/common/twistd --no_save -y buildbot.tac
+ @echo 'Waiting for creation of twistd.pid...'
+ while `test ! -f twistd.pid`; do sleep 1; done;
dsansome 2016/03/18 00:01:57 What if twistd.pid is never created? Does master
ifeq ($(BUILDBOT_PATH),$(BUILDBOT8_PATH))
start-prof: bootstrap
@@ -111,6 +118,9 @@ last-restart:
wait:
while `test -f twistd.pid`; do sleep 1; done;
+waitforstart:
+ while `test ! -f twistd.pid`; do sleep 1; done;
+
restart: notify stop wait start log
restart-prof: stop wait start-prof log
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698