mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
send SIGQUIT/SIGTERM only once to the workers
there is no need to send more than once the signal to the workers when exiting. With this patch we are sending once the QUIT/TERM signal and then wait until the graceful timeout or until there are workers alive. fix #655
This commit is contained in:
parent
e63df69229
commit
d1a0973225
@ -348,9 +348,12 @@ class Arbiter(object):
|
||||
if not graceful:
|
||||
sig = signal.SIGQUIT
|
||||
limit = time.time() + self.cfg.graceful_timeout
|
||||
# instruct the workers to exit
|
||||
self.kill_workers(sig)
|
||||
# wait until the graceful timeout
|
||||
while self.WORKERS and time.time() < limit:
|
||||
self.kill_workers(sig)
|
||||
time.sleep(0.1)
|
||||
|
||||
self.kill_workers(signal.SIGKILL)
|
||||
|
||||
def reexec(self):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user