From 3cbbc713b15a9871651d900a05ae9c229530373b Mon Sep 17 00:00:00 2001 From: benoitc Date: Fri, 13 May 2016 11:09:14 +0200 Subject: [PATCH] don't kill ourself on reload Killing ourself when using the `--reload` option trigger an infinite loop under some monitoring services like the one in pycharm and don't reload the file. Instead set self.alive as False which will trigger later the worker exit. Note that if we want to force the exit we could also use sys.exit(0) . fix #1129 --- gunicorn/workers/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gunicorn/workers/base.py b/gunicorn/workers/base.py index d187a611..7bee64c5 100644 --- a/gunicorn/workers/base.py +++ b/gunicorn/workers/base.py @@ -89,7 +89,7 @@ class Worker(object): if self.cfg.reload: def changed(fname): self.log.info("Worker reloading: %s modified", fname) - os.kill(self.pid, signal.SIGQUIT) + self.alive = False self.reloader = Reloader(callback=changed) self.reloader.start()