try not to let problems responding to kill -QUIT (which prints stack trace of each thread) kill the whole process

This commit is contained in:
Noah Levitt 2017-06-12 16:51:50 -07:00
parent 808950abb4
commit 2f0c4454ac

View File

@ -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('<n/a:AssertionError>')
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('<n/a:%r>' % e)
logging.warn(
'dumping state (caught signal %s)\n%s',