Add support for SQL idle timeout.

Previously, glance logged frequent
database-has-gone-away errors.

This patch adds a parameter that can configure
the sql_idle_timeout which can be decreased
to reduce these errors.

More information on this issue can be found here:
  https://bugs.launchpad.net/nova/+bug/1007027 for more details.

Change-Id: I8e3133d3bbd447095450ed40d321682dac5616cf
This commit is contained in:
danehans
2013-07-01 22:01:35 +00:00
parent 3c0fd00fe9
commit 8cf6e1fc85
2 changed files with 4 additions and 0 deletions

View File

@@ -14,6 +14,7 @@
# [db_password] Password for glance DB. Required. # [db_password] Password for glance DB. Required.
# [db_host] Host where DB resides. Required. # [db_host] Host where DB resides. Required.
# [keystone_host] Host whre keystone is running. Optional. Defaults to '127.0.0.1' # [keystone_host] Host whre keystone is running. Optional. Defaults to '127.0.0.1'
# [sql_idle_timeout] Timeout for SQL to reap connections. Optional. Defaults to '3600'
# [db_type] Type of sql databse to use. Optional. Defaults to 'mysql' # [db_type] Type of sql databse to use. Optional. Defaults to 'mysql'
# [db_user] Name of glance DB user. Optional. Defaults to 'glance' # [db_user] Name of glance DB user. Optional. Defaults to 'glance'
# [db_name] Name of glance DB. Optional. Defaults to 'glance' # [db_name] Name of glance DB. Optional. Defaults to 'glance'
@@ -38,6 +39,7 @@ class openstack::glance (
$db_password, $db_password,
$db_host = '127.0.0.1', $db_host = '127.0.0.1',
$keystone_host = '127.0.0.1', $keystone_host = '127.0.0.1',
$sql_idle_timeout = '3600',
$db_type = 'mysql', $db_type = 'mysql',
$db_user = 'glance', $db_user = 'glance',
$db_name = 'glance', $db_name = 'glance',
@@ -67,6 +69,7 @@ class openstack::glance (
keystone_user => 'glance', keystone_user => 'glance',
keystone_password => $user_password, keystone_password => $user_password,
sql_connection => $sql_connection, sql_connection => $sql_connection,
sql_idle_timeout => $sql_idle_timeout,
enabled => $enabled, enabled => $enabled,
} }

View File

@@ -29,6 +29,7 @@ describe 'openstack::glance' do
:keystone_user => 'glance', :keystone_user => 'glance',
:keystone_password => 'glance_user_pass', :keystone_password => 'glance_user_pass',
:sql_connection => 'mysql://glance:glance_db_pass@127.0.0.1/glance', :sql_connection => 'mysql://glance:glance_db_pass@127.0.0.1/glance',
:sql_idle_timeout => '3600',
:enabled => true :enabled => true
) )
should contain_class('glance::registry').with( should contain_class('glance::registry').with(