From 7f6e61f534de20e3139c1f07d2c4b509c099925e 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: I3c068e51ebc4a6dd71a53adef63f52676a0cc5ee Closes-Bug: #1757581 --- manifests/db.pp | 6 ++++++ .../add-pool_timeout-option-for-db-b4cac6e4f26fcf7d.yaml | 5 +++++ spec/classes/congress_db_spec.rb | 3 +++ 3 files changed, 14 insertions(+) create mode 100644 releasenotes/notes/add-pool_timeout-option-for-db-b4cac6e4f26fcf7d.yaml diff --git a/manifests/db.pp b/manifests/db.pp index 1dfb6c0..e364505 100644 --- a/manifests/db.pp +++ b/manifests/db.pp @@ -38,6 +38,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 +# class congress::db ( $database_connection = 'sqlite:////var/lib/congress/congress.sqlite', $database_idle_timeout = $::os_service_default, @@ -47,6 +51,7 @@ class congress::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, ) { include ::congress::deps @@ -63,5 +68,6 @@ class congress::db ( retry_interval => $database_retry_interval, max_pool_size => $database_max_pool_size, max_overflow => $database_max_overflow, + pool_timeout => $database_max_overflow, } } diff --git a/releasenotes/notes/add-pool_timeout-option-for-db-b4cac6e4f26fcf7d.yaml b/releasenotes/notes/add-pool_timeout-option-for-db-b4cac6e4f26fcf7d.yaml new file mode 100644 index 0000000..be30389 --- /dev/null +++ b/releasenotes/notes/add-pool_timeout-option-for-db-b4cac6e4f26fcf7d.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/congress_db_spec.rb b/spec/classes/congress_db_spec.rb index 97e1922..b99ab2d 100644 --- a/spec/classes/congress_db_spec.rb +++ b/spec/classes/congress_db_spec.rb @@ -13,6 +13,7 @@ describe 'congress::db' do :max_retries => '', :retry_interval => '', :max_overflow => '', + :pool_timeout => '', )} end @@ -26,6 +27,7 @@ describe 'congress::db' do :database_retry_interval => '11', :database_max_pool_size => '11', :database_max_overflow => '21', + :database_pool_timeout => '21', } end @@ -38,6 +40,7 @@ describe 'congress::db' do :max_retries => '11', :retry_interval => '11', :max_overflow => '21', + :pool_timeout => '21', )} end