diff options
author | Simon Westphahl <simon.westphahl@bmw.de> | 2022-11-30 11:52:39 +0100 |
---|---|---|
committer | Simon Westphahl <simon.westphahl@bmw.de> | 2022-12-01 07:32:55 +0100 |
commit | 71598ee51bb451e4fa324165618bcb0c41f80700 (patch) | |
tree | 2e04e7cac056b79c85909cc20dd64f4bf361bf1b | |
parent | 5443a0f51bbd9060bf36ac37fd3f08d237adc04b (diff) | |
download | zuul-71598ee51bb451e4fa324165618bcb0c41f80700.tar.gz |
Allow clean scheduler shutdown when priming fails
If config priming failed we need to unblock the main thread by setting
the primed event so we can join the main thread during shutdown.
So far this was only done after trying to join the main thread, so we
need to set the primed event earlier.
Change-Id: I5aef9a215cfd53baa94e525f8c303592a6c7e4b8
-rw-r--r-- | zuul/scheduler.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/zuul/scheduler.py b/zuul/scheduler.py index 42f8afbb0..83d74fb43 100644 --- a/zuul/scheduler.py +++ b/zuul/scheduler.py @@ -369,6 +369,9 @@ class Scheduler(threading.Thread): self.log.debug("Stopping scheduler") self._stopped = True self.wake_event.set() + # Main thread, connections and layout update may be waiting + # on the primed event + self.primed_event.set() self.start_cleanup_thread.join() self.log.debug("Stopping apscheduler") self.apsched.shutdown() @@ -382,8 +385,6 @@ class Scheduler(threading.Thread): self.log.debug("Stopping nodepool") self.nodepool.stop() self.log.debug("Stopping connections") - # Connections and layout update may be waiting on the primed event - self.primed_event.set() # Layout update can reconfigure connections, so make sure # layout update is stopped first. self.log.debug("Waiting for layout update thread") |