summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2010-08-04 07:03:53 -0500
committerDan McGee <dan@archlinux.org>2010-08-04 07:06:49 -0500
commitefba7e8ba08a15684d5f5cc24bf813ee53b13a47 (patch)
tree33137d0fd458b6715dfdf19d33d338c7c55cbf62
parent8e1b9a8424eb96df27f13ef61846f884e113a431 (diff)
reporead: Add ability to generate traceback via signalrelease_2010-08-08
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 <dan@archlinux.org>
-rw-r--r--devel/management/commands/reporead.py4
1 files changed, 4 insertions, 0 deletions
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)