Merge "Centrally register stack dump handler" into feature/zuulv3

This commit is contained in:
Zuul 2018-01-17 05:47:06 +00:00 committed by Gerrit Code Review
commit 168a94117b
5 changed files with 4 additions and 7 deletions

View File

@ -176,6 +176,10 @@ class ZuulDaemonApp(ZuulApp):
pid_fn = self.getPidFile()
pid = pid_file_module.TimeoutPIDLockFile(pid_fn, 10)
# Early register the stack dump handler for all zuul apps. This makes
# it possible to also gather stack dumps during startup hangs.
signal.signal(signal.SIGUSR2, stack_dump_handler)
if self.args.nodaemon:
self.run()
else:

View File

@ -109,8 +109,6 @@ class Executor(zuul.cmd.ZuulDaemonApp):
log_streaming_port=self.finger_port)
self.executor.start()
signal.signal(signal.SIGUSR2, zuul.cmd.stack_dump_handler)
if self.args.nodaemon:
signal.signal(signal.SIGTERM, self.exit_handler)
while True:

View File

@ -62,8 +62,6 @@ class Merger(zuul.cmd.ZuulDaemonApp):
self.connections)
self.merger.start()
signal.signal(signal.SIGUSR2, zuul.cmd.stack_dump_handler)
if self.args.nodaemon:
signal.signal(signal.SIGTERM, self.exit_handler)
while True:

View File

@ -123,7 +123,6 @@ class Scheduler(zuul.cmd.ZuulDaemonApp):
import zuul.webapp
import zuul.zk
signal.signal(signal.SIGUSR2, zuul.cmd.stack_dump_handler)
if (self.config.has_option('gearman_server', 'start') and
self.config.getboolean('gearman_server', 'start')):
self.start_gear_server()

View File

@ -106,8 +106,6 @@ class WebServer(zuul.cmd.ZuulDaemonApp):
self.configure_connections()
signal.signal(signal.SIGUSR2, zuul.cmd.stack_dump_handler)
try:
self._run()
except Exception: