From e591059358cd92eee644ad10e1120ecd2d48848b Mon Sep 17 00:00:00 2001 From: "Paul J. Davis" Date: Mon, 15 Nov 2010 21:37:15 -0500 Subject: [PATCH] Set the number of workers to zero on WINCH. We need to update the number of workers so they aren't restarted the next time the arbiter wakes up and runs manage_workers. Also fixed a typo for the log statement. Thanks to Randall Leeds for the report and patch. --- gunicorn/arbiter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gunicorn/arbiter.py b/gunicorn/arbiter.py index e3146dba..4e631dc5 100644 --- a/gunicorn/arbiter.py +++ b/gunicorn/arbiter.py @@ -251,7 +251,8 @@ class Arbiter(object): def handle_winch(self): "SIGWINCH handling" if os.getppid() == 1 or os.getpgrp() != os.getpid(): - self.logger.info("graceful stop of workers") + self.log.info("graceful stop of workers") + self.num_workers = 0 self.kill_workers(signal.SIGQUIT) else: self.log.info("SIGWINCH ignored. Not daemonized")