mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Merge pull request #745 from tilgovi/worker-signals-mixup
Fix mixed up worker signal handling
This commit is contained in:
commit
b9d291e692
@ -35,8 +35,8 @@ Sending signals directly to the worker processes should not normally be
|
|||||||
needed. If the master process is running, any exited worker will be
|
needed. If the master process is running, any exited worker will be
|
||||||
automatically respawned.
|
automatically respawned.
|
||||||
|
|
||||||
- **QUIT**, **INT**: Graceful shutdown
|
- **QUIT**, **INT**: Quick shutdown
|
||||||
- **TERM**: Quick shutdown
|
- **TERM**: Graceful shutdown
|
||||||
- **USR1**: Reopen the log files
|
- **USR1**: Reopen the log files
|
||||||
|
|
||||||
Reload the configuration
|
Reload the configuration
|
||||||
|
|||||||
@ -336,9 +336,9 @@ class Arbiter(object):
|
|||||||
killed gracefully (ie. trying to wait for the current connection)
|
killed gracefully (ie. trying to wait for the current connection)
|
||||||
"""
|
"""
|
||||||
self.LISTENERS = []
|
self.LISTENERS = []
|
||||||
sig = signal.SIGQUIT
|
sig = signal.SIGTERM
|
||||||
if not graceful:
|
if not graceful:
|
||||||
sig = signal.SIGTERM
|
sig = signal.SIGQUIT
|
||||||
limit = time.time() + self.cfg.graceful_timeout
|
limit = time.time() + self.cfg.graceful_timeout
|
||||||
while self.WORKERS and time.time() < limit:
|
while self.WORKERS and time.time() < limit:
|
||||||
self.kill_workers(sig)
|
self.kill_workers(sig)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user