diff --git a/gunicorn/arbiter.py b/gunicorn/arbiter.py index 646d684ef..686764e83 100644 --- a/gunicorn/arbiter.py +++ b/gunicorn/arbiter.py @@ -503,8 +503,8 @@ def murder_workers(self): if not worker.aborted: self.log.critical("WORKER TIMEOUT (pid:%s)", pid) - worker.aborted = True self.kill_worker(pid, signal.SIGABRT) + worker.aborted = True else: self.kill_worker(pid, signal.SIGKILL) diff --git a/gunicorn/workers/base.py b/gunicorn/workers/base.py index 93c465c98..1cef731c1 100644 --- a/gunicorn/workers/base.py +++ b/gunicorn/workers/base.py @@ -199,8 +199,9 @@ def handle_quit(self, sig, frame): sys.exit(0) def handle_abort(self, sig, frame): - self.alive = False self.cfg.worker_abort(self) + self.alive = False + time.sleep(0.1) sys.exit(1) def handle_error(self, req, client, addr, exc):