SIGUSR2 logs stack traces for active threads.
* doc/source/zuul.rst: Document SIGUSR2 behavior.
* zuul/cmd/server.py: When SIGUSR2 is received log stack traces for all
active running threads. This is useful for debugging deadlock
situations. Note that this makes use of sys._current_frames which may
not play nice with all implementations of Python.
*tests/test_stack_dump.py: Test the stack dump signal handler with a new
test file, class, and test method.
* requirements.txt: Add argparse to requirements list so that py26 tests
can pass when zuul.cmd.server is imported.
Change-Id: I8ad8155b16f324e832c191f0a619ff89ef804a87
diff --git a/doc/source/zuul.rst b/doc/source/zuul.rst
index d1cbbc5..73ebf71 100644
--- a/doc/source/zuul.rst
+++ b/doc/source/zuul.rst
@@ -653,3 +653,7 @@
http://zuul.openstack.org/ gate 'reverify no bug'
./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.