Add pool_timeout option

Add pool_timeout option to configure this value for pool_timeout with
SQLAlchemy.

Change-Id: I84f37d54f4064f2ca0a780548b6db6ebe6786e43
Closes-Bug: #1757581
This commit is contained in:
ZhongShengping 2018-03-22 11:09:50 +08:00
parent 30af5dd9c8
commit 9cc371cb4d
3 changed files with 14 additions and 0 deletions

View File

@ -33,6 +33,10 @@
# If set, use this value for max_overflow with sqlalchemy.
# (Optional) Defaults to $::os_service_default
#
# [*database_pool_timeout*]
# (Optional) If set, use this value for pool_timeout with SQLAlchemy.
# 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.
@ -46,6 +50,7 @@ class rally::db (
$database_max_retries = $::os_service_default,
$database_retry_interval = $::os_service_default,
$database_max_overflow = $::os_service_default,
$database_pool_timeout = $::os_service_default,
$database_db_max_retries = $::os_service_default,
) {
@ -81,6 +86,7 @@ class rally::db (
max_retries => $database_max_retries_real,
retry_interval => $database_retry_interval_real,
max_overflow => $database_max_overflow_real,
pool_timeout => $database_pool_timeout,
db_max_retries => $database_db_max_retries,
}

View File

@ -0,0 +1,5 @@
---
features:
- |
Adds the pool_timeout option for configuring oslo.db. This will
configure this value for pool_timeout with SQLAlchemy.

View File

@ -13,6 +13,7 @@ describe 'rally::db' do
:max_retries => '<SERVICE DEFAULT>',
:retry_interval => '<SERVICE DEFAULT>',
:max_overflow => '<SERVICE DEFAULT>',
:pool_timeout => '<SERVICE DEFAULT>',
)}
it 'should create sqlite rally directory' do
@ -36,6 +37,7 @@ describe 'rally::db' do
:database_retry_interval => '11',
:database_max_pool_size => '11',
:database_max_overflow => '21',
:database_pool_timeout => '21',
:database_db_max_retries => '-1',
}
end
@ -49,6 +51,7 @@ describe 'rally::db' do
:max_retries => '11',
:retry_interval => '11',
:max_overflow => '21',
:pool_timeout => '21',
)}
it 'should not create sqlite rally directory' do
is_expected.to_not contain_file('create_sqlite_directory')