From 3321987dfcc9f00a65216a173581e9d5869e2693 Mon Sep 17 00:00:00 2001 From: Dave Shawley Date: Thu, 15 Mar 2018 07:28:34 -0400 Subject: [PATCH] Runner: remove logging from signal handler. It turns out that logging.Logger SHOULD NOT be used in signal handlers. We are running into this elsewhere in the system so that is absolutely no reason to risk it here. ref: https://docs.python.org/3/library/logging.html#thread-safety --- docs/history.rst | 8 ++++++++ sprockets/http/runner.py | 1 - 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/history.rst b/docs/history.rst index 702a46d..9864760 100644 --- a/docs/history.rst +++ b/docs/history.rst @@ -3,6 +3,14 @@ Release History =============== +`Next Release`_ +--------------- +- Remove logging from the signal handler. Logger's cannot safely be used + from within signal handlers. See `Thread Safety`_ in the logging module + documentation for details. + +.. _Thread Safety: https://docs.python.org/3/library/logging.html#thread-safety + `1.5.0`_ (29 Jan 2018) ---------------------- - Enable port reuse for Tornado versions newer than 4.3. diff --git a/sprockets/http/runner.py b/sprockets/http/runner.py index ab48f21..6f008ad 100644 --- a/sprockets/http/runner.py +++ b/sprockets/http/runner.py @@ -139,7 +139,6 @@ class Runner(object): iol.start() def _on_signal(self, signo, frame): - self.logger.info('signal %s received, stopping', signo) ioloop.IOLoop.instance().add_callback_from_signal(self._shutdown) def _shutdown(self):