handle graceful shutdown failure

print stack trace and kill myself -9
This commit is contained in:
Noah Levitt 2019-04-24 13:14:12 -07:00
parent de01d498cb
commit 38d6e4337d
2 changed files with 7 additions and 2 deletions

View File

@ -42,7 +42,7 @@ except:
setuptools.setup(
name='warcprox',
version='2.4.7',
version='2.4.8',
description='WARC writing MITM HTTP/S proxy',
url='https://github.com/internetarchive/warcprox',
author='Noah Levitt',

View File

@ -441,7 +441,12 @@ class WarcproxController(object):
exc_info=True)
pass
finally:
self.shutdown()
try:
self.shutdown()
except:
self.logger.critical("graceful shutdown failed", exc_info=True)
self.logger.critical("killing myself -9")
os.kill(os.getpid(), 9)
def _dump_profiling(self):
import pstats, tempfile, os, io