From 83f9db704cdc09633d07d363cb85a648cc1b37d4 Mon Sep 17 00:00:00 2001 From: ZhongShengping Date: Mon, 23 Nov 2020 09:27:52 +0800 Subject: [PATCH] Allow db sync timeouts to be configurable As Openstack projects continue to have longer database migration chains, the Puppet default timeout of 300 seconds for an execution is becoming too short a duration on some hardware, leading to timeouts. As projects continue to add more migration scripts without pruning the base, timeouts will continue to become more frequent unless this time can be expanded. Change-Id: Icd6698d7b15344b7ab1c14aad08ebc1cd61346f6 Closes-Bug: #1904962 --- manifests/db/sync.pp | 8 +++++++- .../notes/add_db_sync_timeout-bdc2f73a51104c30.yaml | 3 +++ spec/classes/glance_db_sync_spec.rb | 5 ++++- 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/add_db_sync_timeout-bdc2f73a51104c30.yaml diff --git a/manifests/db/sync.pp b/manifests/db/sync.pp index 8c579305..f320e7cb 100644 --- a/manifests/db/sync.pp +++ b/manifests/db/sync.pp @@ -9,8 +9,13 @@ # in the command line between 'glance-manage' and 'db sync'. # Defaults to '' # +# [*db_sync_timeout*] +# (Optional) Timeout for the execution of the db_sync +# Defaults to 300 +# class glance::db::sync( - $extra_params = '', + $extra_params = '', + $db_sync_timeout = 300, ) { include glance::deps @@ -22,6 +27,7 @@ class glance::db::sync( refreshonly => true, try_sleep => 5, tries => 10, + timeout => $db_sync_timeout, logoutput => on_failure, subscribe => [ Anchor['glance::install::end'], diff --git a/releasenotes/notes/add_db_sync_timeout-bdc2f73a51104c30.yaml b/releasenotes/notes/add_db_sync_timeout-bdc2f73a51104c30.yaml new file mode 100644 index 00000000..233445f6 --- /dev/null +++ b/releasenotes/notes/add_db_sync_timeout-bdc2f73a51104c30.yaml @@ -0,0 +1,3 @@ +--- +features: + - Adds db_sync_timeout parameter to db sync. diff --git a/spec/classes/glance_db_sync_spec.rb b/spec/classes/glance_db_sync_spec.rb index 78bdb190..2ebaeeef 100644 --- a/spec/classes/glance_db_sync_spec.rb +++ b/spec/classes/glance_db_sync_spec.rb @@ -14,6 +14,7 @@ describe 'glance::db::sync' do :refreshonly => 'true', :try_sleep => 5, :tries => 10, + :timeout => 300, :logoutput => 'on_failure', :subscribe => ['Anchor[glance::install::end]', 'Anchor[glance::config::end]', @@ -26,7 +27,8 @@ describe 'glance::db::sync' do describe "overriding extra_params" do let :params do { - :extra_params => '--config-file /etc/glance/glance.conf', + :extra_params => '--config-file /etc/glance/glance.conf', + :db_sync_timeout => 750, } end @@ -37,6 +39,7 @@ describe 'glance::db::sync' do :refreshonly => 'true', :try_sleep => 5, :tries => 10, + :timeout => 750, :logoutput => 'on_failure', :subscribe => ['Anchor[glance::install::end]', 'Anchor[glance::config::end]',