mirror of
https://github.com/internetarchive/warcprox.git
synced 2025-01-18 13:22:09 +01:00
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:
parent
808950abb4
commit
2f0c4454ac
@ -142,10 +142,10 @@ def dump_state(signum=None, frame=None):
|
|||||||
for th in threading.enumerate():
|
for th in threading.enumerate():
|
||||||
try:
|
try:
|
||||||
state_strs.append(str(th))
|
state_strs.append(str(th))
|
||||||
except AssertionError:
|
stack = traceback.format_stack(sys._current_frames()[th.ident])
|
||||||
state_strs.append('<n/a:AssertionError>')
|
state_strs.append(''.join(stack))
|
||||||
stack = traceback.format_stack(sys._current_frames()[th.ident])
|
except Exception as e:
|
||||||
state_strs.append(''.join(stack))
|
state_strs.append('<n/a:%r>' % e)
|
||||||
|
|
||||||
logging.warn(
|
logging.warn(
|
||||||
'dumping state (caught signal %s)\n%s',
|
'dumping state (caught signal %s)\n%s',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user