From efba7e8ba08a15684d5f5cc24bf813ee53b13a47 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 4 Aug 2010 07:03:53 -0500 Subject: reporead: Add ability to generate traceback via signal Every once in a while we see this command hanging on the main server but it isn't making any system calls, so it is hard to tell where it is getting stuck. Add a signal handler on SIGQUIT that will listen and print a traceback when signaled. This is the easiest thing to implement; future additions may need to be able to hook up to a remote debugger (e.g. pdb) if this doesn't work. Signed-off-by: Dan McGee --- devel/management/commands/reporead.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/devel/management/commands/reporead.py b/devel/management/commands/reporead.py index 21021b39..598c0194 100644 --- a/devel/management/commands/reporead.py +++ b/devel/management/commands/reporead.py @@ -82,6 +82,10 @@ class Command(BaseCommand): elif v == 2: logger.level = DEBUG + import signal,traceback + signal.signal(signal.SIGQUIT, + lambda sig, stack: traceback.print_stack(stack)) + return read_repo(arch, file, options) -- cgit v1.2.3-55-g3dc8