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

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

Issue 1890453006: Revert of Flock master startup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 4 years, 8 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 | « .gitignore ('k') | masters/start_master.sh » ('j') | 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 62758e352b92564267e03dabd10aaf6c926c9a0f..a8b72e654c4b338ef119c8dca7894b33327c6d67 100644
--- a/masters/master-common-rules.mk
+++ b/masters/master-common-rules.mk
@@ -24,12 +24,6 @@
# include this file.
SHORT_HOSTNAME := $(shell hostname -s)
CURRENT_DIR = $(shell pwd)
-
-# Where we expect flock to live.
-FLOCK = /usr/bin/flock
-
-# Per-master lockfile.
-LOCKFILE = master_start.lock
printstep:
ifndef NO_REVISION_AUDIT
@@ -69,14 +63,15 @@
|| echo 'Running send_monitoring_event failed, skipping sending events.' \
) 2>&1 | tee -a actions.log
endif
-ifneq ($(wildcard $(FLOCK)),)
- PYTHONPATH=$(PYTHONPATH) SCRIPTS_DIR=$(SCRIPTS_DIR) $(FLOCK) -n $(LOCKFILE) $(TOPLEVEL_DIR)/masters/start_master.sh || ( \
- echo "Failure to start master. Check to see if a master is running and" \
- "holding the lock on $(LOCKFILE)."; exit 1)
-else
- PYTHONPATH=$(PYTHONPATH) SCRIPTS_DIR=$(SCRIPTS_DIR) $(TOPLEVEL_DIR)/masters/start_master.sh
-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;
ifeq ($(BUILDBOT_PATH),$(BUILDBOT8_PATH))
start-prof: bootstrap
« no previous file with comments | « .gitignore ('k') | masters/start_master.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698