Skip to content

Commit 73ae038

Browse files
bingyun123Zhang Yunfeng
authored andcommitted
fix: the worker_abort hook interrupted after executing part
1 parent bacbf8a commit 73ae038

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

gunicorn/arbiter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,8 +503,8 @@ def murder_workers(self):
503503

504504
if not worker.aborted:
505505
self.log.critical("WORKER TIMEOUT (pid:%s)", pid)
506-
worker.aborted = True
507506
self.kill_worker(pid, signal.SIGABRT)
507+
worker.aborted = True
508508
else:
509509
self.kill_worker(pid, signal.SIGKILL)
510510

gunicorn/workers/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,9 @@ def handle_quit(self, sig, frame):
199199
sys.exit(0)
200200

201201
def handle_abort(self, sig, frame):
202-
self.alive = False
203202
self.cfg.worker_abort(self)
203+
self.alive = False
204+
time.sleep(0.1)
204205
sys.exit(1)
205206

206207
def handle_error(self, req, client, addr, exc):

0 commit comments

Comments
 (0)