Chromium Code Reviews| 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 |