Add pool_timeout option

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

Change-Id: I603e20dc124cc1c68025382b35ac6e2003fae772
Closes-Bug: #1757581
This commit is contained in:
ZhongShengping 2018-03-22 11:09:50 +08:00
parent a51b1e0d66
commit 4c639cb127
3 changed files with 14 additions and 0 deletions

View File

@ -48,6 +48,10 @@
# before error is raised. Set to -1 to specify an infinite retry count.
# Defaults to $::os_service_default
#
# [*database_pool_timeout*]
# (Optional) If set, use this value for pool_timeout with SQLAlchemy.
# Defaults to $::os_service_default
#
class barbican::db (
$database_connection = 'sqlite:////var/lib/barbican/barbican.sqlite',
$database_idle_timeout = $::os_service_default,
@ -58,6 +62,7 @@ class barbican::db (
$database_max_overflow = $::os_service_default,
$database_pool_size = $::os_service_default,
$database_db_max_retries = $::os_service_default,
$database_pool_timeout = $::os_service_default,
) {
include ::barbican::deps
@ -74,6 +79,7 @@ class barbican::db (
retry_interval => $database_retry_interval,
max_overflow => $database_max_overflow,
db_max_retries => $database_db_max_retries,
pool_timeout => $database_pool_timeout,
}
# TODO(aschultz): Remove this config once barbican properly leverages oslo

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

@ -34,6 +34,7 @@ describe 'barbican::db' do
:max_retries => '<SERVICE DEFAULT>',
:retry_interval => '<SERVICE DEFAULT>',
:max_overflow => '<SERVICE DEFAULT>',
:pool_timeout => '<SERVICE DEFAULT>',
)}
# TODO(aschultz): remove once oslo is properly used
@ -53,6 +54,7 @@ describe 'barbican::db' do
:database_max_retries => '11',
:database_retry_interval => '11',
:database_max_overflow => '11',
:database_pool_timeout => '11',
:database_pool_size => '2',
:database_db_max_retries => '-1',
}
@ -67,6 +69,7 @@ describe 'barbican::db' do
:max_retries => '11',
:retry_interval => '11',
:max_overflow => '11',
:pool_timeout => '11',
)}
# TODO(aschultz) remove once oslo is properly used