benoitc/gunicorn — pull request #419 by tilgovi (2012-10-15 21:15:09+00:00)
Title: 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.