From e1e634a8aae004fccdc337b14207f9895edc1531 Mon Sep 17 00:00:00 2001 From: "Paul J. Davis" Date: Mon, 6 Jun 2011 06:34:14 -0400 Subject: [PATCH] Fixed Tornado worker exiting. Thanks to Masahiro Nakagawa for the report and patch. Fixes #216 --- THANKS | 1 + gunicorn/workers/gtornado.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/THANKS b/THANKS index c9e5386f..a115e34c 100644 --- a/THANKS +++ b/THANKS @@ -29,3 +29,4 @@ Dan Sully Fabian Topfstedt Denis Bilenko Michael Schurter +Masahiro Nakagawa diff --git a/gunicorn/workers/gtornado.py b/gunicorn/workers/gtornado.py index b7a08b02..c6b5d98c 100644 --- a/gunicorn/workers/gtornado.py +++ b/gunicorn/workers/gtornado.py @@ -30,6 +30,10 @@ class TornadoWorker(Worker): web.RequestHandler.clear = clear sys.modules["tornado.web"] = web + def handle_quit(self, sig, frame): + super(TornadoWorker, self).handle_quit(sig, frame) + self.ioloop.stop() + def watchdog(self): self.notify()