Skip to content

Commit

Permalink
Merge "Add pool_timeout option"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and openstack-gerrit committed Mar 27, 2018
2 parents 6768a28 + 7b4078b commit 95b91f4
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
6 changes: 6 additions & 0 deletions manifests/api/db.pp
Expand Up @@ -38,6 +38,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
#
class glance::api::db (
$database_db_max_retries = $::os_service_default,
$database_connection = 'sqlite:///var/lib/glance/glance.sqlite',
Expand All @@ -47,6 +51,7 @@
$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 ::glance::deps
Expand All @@ -73,5 +78,6 @@
retry_interval => $database_retry_interval_real,
max_pool_size => $database_max_pool_size_real,
max_overflow => $database_max_overflow_real,
pool_timeout => $database_pool_timeout,
}
}
6 changes: 6 additions & 0 deletions manifests/registry/db.pp
Expand Up @@ -38,6 +38,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
#
class glance::registry::db (
$database_db_max_retries = $::os_service_default,
$database_connection = 'sqlite:///var/lib/glance/glance.sqlite',
Expand All @@ -47,6 +51,7 @@
$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 ::glance::deps
Expand All @@ -73,5 +78,6 @@
retry_interval => $database_retry_interval_real,
max_pool_size => $database_max_pool_size_real,
max_overflow => $database_max_overflow_real,
pool_timeout => $database_pool_timeout,
}
}
@@ -0,0 +1,5 @@
---
features:
- |
Adds the pool_timeout option for configuring oslo.db. This will
configure this value for pool_timeout with SQLAlchemy.
3 changes: 3 additions & 0 deletions spec/classes/glance_api_db_spec.rb
Expand Up @@ -13,6 +13,7 @@
:max_retries => '<SERVICE DEFAULT>',
:retry_interval => '<SERVICE DEFAULT>',
:max_overflow => '<SERVICE DEFAULT>',
:pool_timeout => '<SERVICE DEFAULT>',
)}
end

Expand All @@ -26,6 +27,7 @@
:database_retry_interval => '11',
:database_max_pool_size => '11',
:database_max_overflow => '21',
:database_pool_timeout => '21',
}
end

Expand All @@ -38,6 +40,7 @@
:db_max_retries => '-1',
:retry_interval => '11',
:max_overflow => '21',
:pool_timeout => '21',
)}
end

Expand Down
3 changes: 3 additions & 0 deletions spec/classes/glance_registry_db_spec.rb
Expand Up @@ -13,6 +13,7 @@
:max_retries => '<SERVICE DEFAULT>',
:retry_interval => '<SERVICE DEFAULT>',
:max_overflow => '<SERVICE DEFAULT>',
:pool_timeout => '<SERVICE DEFAULT>',
)}
end

Expand All @@ -26,6 +27,7 @@
:database_retry_interval => '11',
:database_max_pool_size => '11',
:database_max_overflow => '21',
:database_pool_timeout => '21',
}
end

Expand All @@ -38,6 +40,7 @@
:max_retries => '11',
:retry_interval => '11',
:max_overflow => '21',
:pool_timeout => '21',
)}
end

Expand Down

0 comments on commit 95b91f4

Please sign in to comment.