wendelin: Teach -dev build to dump all threads traceback on SIGUSR1
Via installing Products.signalstack https://pypi.python.org/pypi/Products.signalstack /reviewed-by @Tyagov
-
Owner
FYI, ERP5 includes by default Products.DeadlockDebugger, so you can use:
curl http://10....:2200/manage_debug_threads?secret
to achieve more or less the same.
For now, you have to hit the backend Zope (not behind apache rewrite rule). The secret key is configured using
deadlock-debugger-password
parameter when requesting ERP5 instance. -
Owner
I just read description in https://pypi.python.org/pypi/Products.signalstack . I now understand there might be a good reason for including this :)
-
Owner
@jerome , yes - Products.signalstack uses just z3c.deadlockdebugger - the whole code of it is
import signal import sys from z3c.deadlockdebugger.threads import dump_threads def showStacks(signal, stack): print dump_threads() sys.stdout.flush() def initialize(contxt): signal.signal(signal.SIGUSR1, showStacks)
The thing here is that we can trigger the dump not only from web, but also via signal, e.g. when for some reason web request handling does not work.
If ERP5 includes Products.DeadlockDebugger by default, I think we could add Products.signalstack to be also available out of the box (you need access to slapos partition to send the signal, so it should be safe to enable)