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: Ib4a04482f7b67b4b38a91031ba9a25670e52d91b Closes-Bug: 1579718
This commit is contained in:
parent
1530294c17
commit
edb85619cb
@ -12,6 +12,11 @@
|
||||
# (Optional) Timeout when db connections should be reaped.
|
||||
# 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_max_retries*]
|
||||
# (Optional) Maximum number of database connection retries during startup.
|
||||
# Setting -1 implies an infinite retry count.
|
||||
@ -38,6 +43,7 @@ class watcher::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,
|
||||
@ -50,6 +56,7 @@ class watcher::db (
|
||||
connection => $database_connection,
|
||||
idle_timeout => $database_idle_timeout,
|
||||
min_pool_size => $database_min_pool_size,
|
||||
db_max_retries => $database_db_max_retries,
|
||||
max_retries => $database_max_retries,
|
||||
retry_interval => $database_retry_interval,
|
||||
max_pool_size => $database_max_pool_size,
|
||||
|
@ -7,6 +7,7 @@ describe 'watcher::db' do
|
||||
it { is_expected.to contain_watcher_config('database/connection').with_value('sqlite:////var/lib/watcher/watcher.sqlite') }
|
||||
it { is_expected.to contain_watcher_config('database/idle_timeout').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_watcher_config('database/min_pool_size').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_watcher_config('database/db_max_retries').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_watcher_config('database/max_retries').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_watcher_config('database/retry_interval').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_watcher_config('database/max_pool_size').with_value('<SERVICE DEFAULT>') }
|
||||
@ -18,6 +19,7 @@ describe 'watcher::db' do
|
||||
{ :database_connection => 'mysql+pymysql://watcher:watcher@localhost/watcher',
|
||||
: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 'watcher::db' do
|
||||
it { is_expected.to contain_watcher_config('database/connection').with_value('mysql+pymysql://watcher:watcher@localhost/watcher') }
|
||||
it { is_expected.to contain_watcher_config('database/idle_timeout').with_value('3601') }
|
||||
it { is_expected.to contain_watcher_config('database/min_pool_size').with_value('2') }
|
||||
it { is_expected.to contain_watcher_config('database/db_max_retries').with_value('-1') }
|
||||
it { is_expected.to contain_watcher_config('database/max_retries').with_value('11') }
|
||||
it { is_expected.to contain_watcher_config('database/retry_interval').with_value('11') }
|
||||
it { is_expected.to contain_watcher_config('database/max_pool_size').with_value('11') }
|
||||
|
Loading…
x
Reference in New Issue
Block a user