Add support for db_max_retries param
The db_max_retries parameter regulates the number of reconnection attempts performed after an error raised rather than at startup. Change-Id: Ibe03fcbf2cec154ae51753fb916705b8b5dcad4d Closes-Bug: 1579718
This commit is contained in:
parent
5f29d12afe
commit
5542e5ad92
@ -13,6 +13,11 @@
|
||||
# Set to -1 to specify an infinite retry count.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*database_db_max_retries*]
|
||||
# (optional) Maximum retries in case of connection error or deadlock error
|
||||
# before error is raised. Set to -1 to specify an infinite retry count.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*database_idle_timeout*]
|
||||
# (Optional) Timeout before idle SQL connections are reaped.
|
||||
# Defaults to $::os_service_default.
|
||||
@ -38,6 +43,7 @@ class vitrage::db (
|
||||
$database_idle_timeout = $::os_service_default,
|
||||
$database_min_pool_size = $::os_service_default,
|
||||
$database_max_pool_size = $::os_service_default,
|
||||
$database_db_max_retries = $::os_service_default,
|
||||
$database_max_retries = $::os_service_default,
|
||||
$database_retry_interval = $::os_service_default,
|
||||
$database_max_overflow = $::os_service_default,
|
||||
@ -59,6 +65,7 @@ class vitrage::db (
|
||||
idle_timeout => $database_idle_timeout_real,
|
||||
min_pool_size => $database_min_pool_size_real,
|
||||
max_pool_size => $database_max_pool_size_real,
|
||||
db_max_retries => $database_db_max_retries,
|
||||
max_retries => $database_max_retries_real,
|
||||
retry_interval => $database_retry_interval_real,
|
||||
max_overflow => $database_max_overflow_real,
|
||||
|
@ -7,6 +7,7 @@ describe 'vitrage::db' do
|
||||
it { is_expected.to contain_vitrage_config('database/connection').with_value('mysql://vitrage:secrete@localhost:3306/vitrage') }
|
||||
it { is_expected.to contain_vitrage_config('database/idle_timeout').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_vitrage_config('database/min_pool_size').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_vitrage_config('database/db_max_retries').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_vitrage_config('database/max_retries').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_vitrage_config('database/retry_interval').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_vitrage_config('database/max_pool_size').with_value('<SERVICE DEFAULT>') }
|
||||
@ -18,6 +19,7 @@ describe 'vitrage::db' do
|
||||
{ :database_connection => 'mysql+pymysql://vitrage:vitrage@localhost/vitrage',
|
||||
:database_idle_timeout => '3601',
|
||||
:database_min_pool_size => '2',
|
||||
:database_db_max_retries => '-1',
|
||||
:database_max_retries => '11',
|
||||
:database_retry_interval => '11',
|
||||
:database_max_pool_size => '11',
|
||||
@ -28,6 +30,7 @@ describe 'vitrage::db' do
|
||||
it { is_expected.to contain_vitrage_config('database/connection').with_value('mysql+pymysql://vitrage:vitrage@localhost/vitrage') }
|
||||
it { is_expected.to contain_vitrage_config('database/idle_timeout').with_value('3601') }
|
||||
it { is_expected.to contain_vitrage_config('database/min_pool_size').with_value('2') }
|
||||
it { is_expected.to contain_vitrage_config('database/db_max_retries').with_value('-1') }
|
||||
it { is_expected.to contain_vitrage_config('database/max_retries').with_value('11') }
|
||||
it { is_expected.to contain_vitrage_config('database/retry_interval').with_value('11') }
|
||||
it { is_expected.to contain_vitrage_config('database/max_pool_size').with_value('11') }
|
||||
|
Loading…
x
Reference in New Issue
Block a user