commit | 477a962861afe2e859179245d6d39cb41f6c499d | [log] [tgz] |
---|---|---|
author | Matthew Treinish <mtreinish@kortar.org> | Fri Aug 04 11:09:26 2017 -0400 |
committer | Dinesh Bhor <dinesh.bhor@nttdata.com> | Wed Sep 06 11:55:04 2017 +0530 |
tree | 59a314a73112284a03333241ed9758e2350514b1 | |
parent | 63651db44ddef10bc629312707ba6d2a349fbc10 [diff] |
Enable graceful shutdown for services 1] Process using uwsgi: uwsgi services doesn't support for graceful shutting down [1]. It requires some changes in unit files [2] including adding below graceful shutdown hook and changing KillSignal: --hook-master-start "unix_signal:15 gracefully_kill_them_all All the steps and changes required are specified in etherpad [1]. 2] Non uwsgi services needs below changes: In [service] section: a. Add KillMode = process b. Add TimeoutStopSec = infinity NOTE: Creating unit file for services other than uwsgi is handled by the 'write_user_unit_file' function [3]. This function is common for all the services so this patch adds the above mentioned parameters for services using ServiceLauncher also though they don't require. Added a new stackrc variable WORKER_TIMEOUT which is required to add graceful shutdown support to uwsgi services. It will be set as a value to 'worker-reload-mercy' [4] in uwsgi file of service. The default value set to this variable is 90. [1] https://etherpad.openstack.org/p/uwsgi-issues [2] https://www.freedesktop.org/software/systemd/man/systemd.kill.html [3] https://github.com/openstack-dev/devstack/blob/2967ca3dfd0d64970dfa5dfa7ac2330ee7aa90ed/functions-common#L1439-L1461 [4] http://uwsgi-docs.readthedocs.io/en/latest/Options.html#worker-reload-mercy Co-Authored-By: Dinesh Bhor <dinesh.bhor@nttdata.com> Change-Id: Ia95291325ce4858b47102dd49504250183f339ab