Tornado add many timeouts internally which can be ignored while graceful stopping.
I think this is probably fine. @benoitc?
👍 @keakon can you eventually squash the commits? Sorry for the delay to review it, I'm incredibly busy these days...
Hello, @benoitc. The first 2 commits were about 2 years ago, and you should have merged it.
Actually, there would be anther issue when I using Supervisor to manage Gunicorn process.
The default graceful_timeout of Gunicorn is 30 seconds. So when I restarting Gunicorn master process, it will wait its workers to exit up to 30 seconds.
But the default stopwaitsecs of Supervisor is 10 seconds. So once the Gunicorn workers didn't exit within 10 seconds, the master would be killed by Supervisor, then the workers would become zombie processes.
I have changed the graceful_timeout to 8 seconds in my project, but I think there could be a mechanism to kill the workers once the master got killed.
I should probably have but I am really busy these days launching a new business.
About the patches can you split the prs? the possible infinite loop should be done in another PR.
About the timeout can't you tell to supervisor to send a SIGTERM instead of a SIGQUIT? There is indeed already a mechanism to exit immediately Gunicorn. If it doesn't work with the tornado worker, let me know.
remove checking timeouts
OK, I have updated the pull request.
Changing the signal is fine, but not graceful. Maybe adding a note in the document would be helpful.
It seems like this is ready to go. I'm going to merge it.
@keakon it's document there:
If you want something more explicit let me know :)