From 231940f0f43c4121562ad1d8770489411b042c8a Mon Sep 17 00:00:00 2001 From: ZhongShengping Date: Thu, 22 Mar 2018 11:09:50 +0800 Subject: [PATCH] Add pool_timeout option Add pool_timeout option to configure this value for pool_timeout with SQLAlchemy. Change-Id: I256a68a971671f1b6076e5fadffbb816fb3553cd Closes-Bug: #1757581 --- manifests/db.pp | 6 ++++++ .../add-pool_timeout-option-for-db-8bd0ac3fcd103476.yaml | 5 +++++ spec/classes/magnum_db_spec.rb | 3 +++ 3 files changed, 14 insertions(+) create mode 100644 releasenotes/notes/add-pool_timeout-option-for-db-8bd0ac3fcd103476.yaml diff --git a/manifests/db.pp b/manifests/db.pp index 289a6e7..ef95cad 100644 --- a/manifests/db.pp +++ b/manifests/db.pp @@ -33,6 +33,10 @@ # (Optional) If set, use this value for max_overflow with sqlalchemy. # 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 magnum::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, ) { @@ -62,6 +67,7 @@ class magnum::db ( max_retries => $database_max_retries, retry_interval => $database_retry_interval, max_overflow => $database_max_overflow, + pool_timeout => $database_pool_timeout, db_max_retries => $database_db_max_retries, } diff --git a/releasenotes/notes/add-pool_timeout-option-for-db-8bd0ac3fcd103476.yaml b/releasenotes/notes/add-pool_timeout-option-for-db-8bd0ac3fcd103476.yaml new file mode 100644 index 0000000..be30389 --- /dev/null +++ b/releasenotes/notes/add-pool_timeout-option-for-db-8bd0ac3fcd103476.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Adds the pool_timeout option for configuring oslo.db. This will + configure this value for pool_timeout with SQLAlchemy. diff --git a/spec/classes/magnum_db_spec.rb b/spec/classes/magnum_db_spec.rb index 3130ea0..1496c32 100644 --- a/spec/classes/magnum_db_spec.rb +++ b/spec/classes/magnum_db_spec.rb @@ -13,6 +13,7 @@ describe 'magnum::db' do :max_retries => '', :retry_interval => '', :max_overflow => '', + :pool_timeout => '', )} end @@ -25,6 +26,7 @@ describe 'magnum::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 @@ -38,6 +40,7 @@ describe 'magnum::db' do :max_retries => '11', :retry_interval => '11', :max_overflow => '21', + :pool_timeout => '21', )} end