Browse code

Config graceful_shutdown_timeout option for services

To avoid hanging services during gracefull shutdown option
graceful_shutdown_timeout should be configured.

Closes-Bug: #1446583

Change-Id: I2b7f0df831d65c55ae8cae241478f49c9641d99f

Marian Horban authored on 2015/10/23 04:47:49
Showing 4 changed files
... ...
@@ -357,7 +357,7 @@ function configure_cinder {
357 357
     iniset $CINDER_CONF DEFAULT os_privileged_user_name nova
358 358
     iniset $CINDER_CONF DEFAULT os_privileged_user_password "$SERVICE_PASSWORD"
359 359
     iniset $CINDER_CONF DEFAULT os_privileged_user_tenant "$SERVICE_TENANT_NAME"
360
-
360
+    iniset $CINDER_CONF DEFAULT graceful_shutdown_timeout "$SERVICE_GRACEFUL_SHUTDOWN_TIMEOUT"
361 361
 }
362 362
 
363 363
 # create_cinder_accounts() - Set up common required cinder accounts
... ...
@@ -115,6 +115,7 @@ function configure_glance {
115 115
     configure_auth_token_middleware $GLANCE_REGISTRY_CONF glance $GLANCE_AUTH_CACHE_DIR/registry
116 116
     iniset $GLANCE_REGISTRY_CONF DEFAULT notification_driver messaging
117 117
     iniset_rpc_backend glance $GLANCE_REGISTRY_CONF
118
+    iniset $GLANCE_REGISTRY_CONF DEFAULT graceful_shutdown_timeout "$SERVICE_GRACEFUL_SHUTDOWN_TIMEOUT"
118 119
 
119 120
     cp $GLANCE_DIR/etc/glance-api.conf $GLANCE_API_CONF
120 121
     iniset $GLANCE_API_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
... ...
@@ -149,6 +150,7 @@ function configure_glance {
149 149
         iniset $GLANCE_API_CONF glance_store swift_store_config_file $GLANCE_SWIFT_STORE_CONF
150 150
         iniset $GLANCE_API_CONF glance_store default_swift_reference ref1
151 151
         iniset $GLANCE_API_CONF glance_store stores "file, http, swift"
152
+        iniset $GLANCE_API_CONF DEFAULT graceful_shutdown_timeout "$SERVICE_GRACEFUL_SHUTDOWN_TIMEOUT"
152 153
 
153 154
         iniset $GLANCE_SWIFT_STORE_CONF ref1 user $SERVICE_TENANT_NAME:glance-swift
154 155
         iniset $GLANCE_SWIFT_STORE_CONF ref1 key $SERVICE_PASSWORD
... ...
@@ -649,6 +649,7 @@ function create_nova_conf {
649 649
         iniset $NOVA_CONF serial_console serialproxy_host "$NOVA_SERVICE_LISTEN_ADDRESS"
650 650
         iniset $NOVA_CONF serial_console enabled True
651 651
     fi
652
+    iniset $NOVA_CONF DEFAULT graceful_shutdown_timeout "$SERVICE_GRACEFUL_SHUTDOWN_TIMEOUT"
652 653
 }
653 654
 
654 655
 function init_nova_cells {
... ...
@@ -669,6 +669,9 @@ fi
669 669
 # Service startup timeout
670 670
 SERVICE_TIMEOUT=${SERVICE_TIMEOUT:-60}
671 671
 
672
+# Service graceful shutdown timeout
673
+SERVICE_GRACEFUL_SHUTDOWN_TIMEOUT=${SERVICE_GRACEFUL_SHUTDOWN_TIMEOUT:-5}
674
+
672 675
 # Support alternative yum -- in future Fedora 'dnf' will become the
673 676
 # only supported installer, but for now 'yum' and 'dnf' are both
674 677
 # available in parallel with compatible CLIs.  Allow manual switching