Commit 404150b7 authored by Kirill Smelkov's avatar Kirill Smelkov

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
parent 6d65a74e
...@@ -7,7 +7,11 @@ parts -= wendelin.core ...@@ -7,7 +7,11 @@ parts -= wendelin.core
parts += wendelin.core-dev parts += wendelin.core-dev
# also tell erp5 to use -dev eggs instead of released ones
[eggs] [eggs]
# tell erp5 to use -dev eggs instead of released ones
eggs -= ${wendelin.core:egg} eggs -= ${wendelin.core:egg}
eggs += ${wendelin.core-dev:egg} eggs += ${wendelin.core-dev:egg}
# kill -USR1 <runzope-pid> -> traceback of all threads -> stdout
# ( logged to slappartX/.slappartX_zope-Y.log )
Products.signalstack
  • 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.

  • I just read description in https://pypi.python.org/pypi/Products.signalstack . I now understand there might be a good reason for including this :)

  • @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)

Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment