mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
fix gevent graceful timeout for real
`server.kill()` is too aggressive. It sends a GreenletExit exception to all the pool workers, causing them to exit immediately. A simple one line fix is to use `server.stop()`. In my testing, it appears that `server.stop_accepting()` will make the server stop listening, but pending connections already in the `accept()` backlog are still handled. With `server.stop()` the accept backlog is not handled, the listener is closed in the worker, but existing requests are allowed to exit gracefully.
This commit is contained in:
parent
883c36862d
commit
fd6c712dd4
@ -79,7 +79,7 @@ class GeventWorker(AsyncWorker):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
# Stop accepting requests
|
# Stop accepting requests
|
||||||
server.kill()
|
server.close()
|
||||||
|
|
||||||
# Handle current requests until graceful_timeout
|
# Handle current requests until graceful_timeout
|
||||||
ts = time.time()
|
ts = time.time()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user