diff options
author | Antoine Musso <hashar@free.fr> | 2014-10-28 21:35:22 +0100 |
---|---|---|
committer | Antoine Musso <hashar@free.fr> | 2015-01-18 21:36:31 +0000 |
commit | 29eab01ba3b0a8157a265dc6c8e027387791f4cc (patch) | |
tree | 630c416921d429ec2cc56da5d6a40a81f1110459 | |
parent | 548cfda41a32fe0e7ee4f72d099b21fdbeb95404 (diff) | |
download | zuul-29eab01ba3b0a8157a265dc6c8e027387791f4cc.tar.gz |
Support stack on Geard embedded server
The Zuul server supports dumping stacktrace by sending a SIGUSR2 signal.
Move the signal registration before the fork of the Gearman embedded
server to make it support the same behavior.
Clarify the relevant documentation to mention the forked process that
supports the embedded Gearman server supports SIGUSR2. Additionally
mentioned the log bucket being used (zuul.stack_dump) which might help
fine tweaking of the logger configuration.
Change-Id: I274cc7aba0eee624aafd3b75de15d6e26bdc8d21
-rw-r--r-- | doc/source/zuul.rst | 8 | ||||
-rwxr-xr-x | zuul/cmd/server.py | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/doc/source/zuul.rst b/doc/source/zuul.rst index 6e9fb05a9..8a6120df8 100644 --- a/doc/source/zuul.rst +++ b/doc/source/zuul.rst @@ -1050,9 +1050,11 @@ recheck changes for the gate and check pipelines respectively:: ./tools/zuul-changes.py --review-host=review.openstack.org \ http://zuul.openstack.org/ check 'recheck no bug' -If you send a SIGUSR2 to the zuul-server process, Zuul will dump a stack -trace for each running thread into its debug log. This is useful for -tracking down deadlock or otherwise slow threads. +If you send a SIGUSR2 to the zuul-server process, or the forked process +that runs the Gearman daemon, Zuul will dump a stack trace for each +running thread into its debug log. It is written under the log bucket +``zuul.stack_dump``. This is useful for tracking down deadlock or +otherwise slow threads. When `yappi <https://code.google.com/p/yappi/>`_ (Yet Another Python Profiler) is available, additional functions' and threads' stats are diff --git a/zuul/cmd/server.py b/zuul/cmd/server.py index 25dab6f42..65b08b405 100755 --- a/zuul/cmd/server.py +++ b/zuul/cmd/server.py @@ -150,6 +150,7 @@ class Server(zuul.cmd.ZuulApp): import zuul.webapp import zuul.rpclistener + 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() @@ -203,7 +204,6 @@ class Server(zuul.cmd.ZuulApp): signal.signal(signal.SIGHUP, self.reconfigure_handler) signal.signal(signal.SIGUSR1, self.exit_handler) - signal.signal(signal.SIGUSR2, zuul.cmd.stack_dump_handler) signal.signal(signal.SIGTERM, self.term_handler) while True: try: |