Closed aleemb closed 6 years ago
Any chance to merge this?
Thanks for the pull request @aleemb. While this does solve your immediate problem, I'd rather handle SIGTERM
properly and gracefully exit, while SIGQUIT
and SIGKILL
will immediately exit. SIGTERM
should finish handling any incoming requests and ensure all outgoing requests have finished before finally exiting (perhaps with a timeout to eventually exit if the current requests do not finish in time). This will ensure that any pending errors are not lost, unless the agent is explicitly killed via SIGQUIT
.
This will match the behaviour of other popular daemons such as gunicorn, nginx, unicorn and even Heroku.
If the process is running via supervisord or similar it needs to be able to terminate via SIGTERM