Merge "Cleanly shutdown zuul scheduler if startup fails"

This commit is contained in:
Zuul 2018-02-13 21:00:55 +00:00 committed by Gerrit Code Review
commit 985bb44679
2 changed files with 2 additions and 0 deletions

View File

@ -159,6 +159,7 @@ class Scheduler(zuul.cmd.ZuulDaemonApp):
self.log.exception("Error starting Zuul:")
# TODO(jeblair): If we had all threads marked as daemon,
# we might be able to have a nicer way of exiting here.
self.sched.stop()
sys.exit(1)
signal.signal(signal.SIGHUP, self.reconfigure_handler)

View File

@ -231,6 +231,7 @@ class Scheduler(threading.Thread):
self.statsd = get_statsd(config)
self.rpc = rpclistener.RPCListener(config, self)
self.stats_thread = threading.Thread(target=self.runStats)
self.stats_thread.daemon = True
self.stats_stop = threading.Event()
# TODO(jeblair): fix this
# Despite triggers being part of the pipeline, there is one trigger set