summaryrefslogtreecommitdiff
path: root/zuul/cmd
diff options
context:
space:
mode:
authorClark Boylan <clark.boylan@gmail.com>2020-05-01 16:15:15 -0700
committerClark Boylan <clark.boylan@gmail.com>2020-05-04 10:07:28 -0700
commitb058ab447e84a8b88ccb6ec5585742e31711490c (patch)
treea9f765c08390ef78f39ba5c8109895853684c232 /zuul/cmd
parent02081b585bda0c9232a7e26efafdb41c6972c826 (diff)
downloadzuul-b058ab447e84a8b88ccb6ec5585742e31711490c.tar.gz
Don't exit zuul-web when signals are received
One of the last things the primary thread in zuul-web does after configuring and starting the service is to call signal.pause(). This causes it to wait for any signal to arrive and once a signal has arrived and been handled we stopped zuul-web and killed the process. This is a problem because SIGUSR2 is expected to toggle preformance and debug tooling in the process. But since we exit after signal.pause() returns we can't do that properly. Fix this by removing the signal.pause() loop entirely and instead wait for the web command thread to die. This command thread is the last thing stopped by ZuulWeb.stop() so we can join() on it to wait for a complete stop of the ZuulWeb service. Change-Id: I66fbb86c25479823faeded8ede9c6204846c35c1
Diffstat (limited to 'zuul/cmd')
-rwxr-xr-xzuul/cmd/web.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/zuul/cmd/web.py b/zuul/cmd/web.py
index a29a98b4f..fe4b2ca4f 100755
--- a/zuul/cmd/web.py
+++ b/zuul/cmd/web.py
@@ -105,13 +105,7 @@ class WebServer(zuul.cmd.ZuulDaemonApp):
self.log.info('Zuul Web Server starting')
self.web.start()
- try:
- signal.pause()
- except KeyboardInterrupt:
- print("Ctrl + C: asking web server to exit nicely...\n")
- self.exit_handler(signal.SIGINT, None)
-
- self.web.stop()
+ self.web.join()
self.log.info("Zuul Web Server stopped")
def configure_authenticators(self):