From 2f0c4454ac438ead86a3882feb30d3968a040ffa Mon Sep 17 00:00:00 2001 From: Noah Levitt Date: Mon, 12 Jun 2017 16:51:50 -0700 Subject: [PATCH] try not to let problems responding to kill -QUIT (which prints stack trace of each thread) kill the whole process --- warcprox/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/warcprox/main.py b/warcprox/main.py index c2f26b3..0940593 100644 --- a/warcprox/main.py +++ b/warcprox/main.py @@ -142,10 +142,10 @@ def dump_state(signum=None, frame=None): for th in threading.enumerate(): try: state_strs.append(str(th)) - except AssertionError: - state_strs.append('') - stack = traceback.format_stack(sys._current_frames()[th.ident]) - state_strs.append(''.join(stack)) + stack = traceback.format_stack(sys._current_frames()[th.ident]) + state_strs.append(''.join(stack)) + except Exception as e: + state_strs.append('' % e) logging.warn( 'dumping state (caught signal %s)\n%s',