From 8cf6e1fc85f2f9bd2243a6b523b5f85172e48873 Mon Sep 17 00:00:00 2001 From: danehans Date: Mon, 1 Jul 2013 22:01:35 +0000 Subject: [PATCH] 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 --- manifests/glance.pp | 3 +++ spec/classes/openstack_glance_spec.rb | 1 + 2 files changed, 4 insertions(+) diff --git a/manifests/glance.pp b/manifests/glance.pp index e83e141..b571d52 100644 --- a/manifests/glance.pp +++ b/manifests/glance.pp @@ -14,6 +14,7 @@ # [db_password] Password for glance DB. Required. # [db_host] Host where DB resides. Required. # [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_user] Name of glance DB user. Optional. Defaults to 'glance' # [db_name] Name of glance DB. Optional. Defaults to 'glance' @@ -38,6 +39,7 @@ class openstack::glance ( $db_password, $db_host = '127.0.0.1', $keystone_host = '127.0.0.1', + $sql_idle_timeout = '3600', $db_type = 'mysql', $db_user = 'glance', $db_name = 'glance', @@ -67,6 +69,7 @@ class openstack::glance ( keystone_user => 'glance', keystone_password => $user_password, sql_connection => $sql_connection, + sql_idle_timeout => $sql_idle_timeout, enabled => $enabled, } diff --git a/spec/classes/openstack_glance_spec.rb b/spec/classes/openstack_glance_spec.rb index 61fab90..e48cd38 100644 --- a/spec/classes/openstack_glance_spec.rb +++ b/spec/classes/openstack_glance_spec.rb @@ -29,6 +29,7 @@ describe 'openstack::glance' do :keystone_user => 'glance', :keystone_password => 'glance_user_pass', :sql_connection => 'mysql://glance:glance_db_pass@127.0.0.1/glance', + :sql_idle_timeout => '3600', :enabled => true ) should contain_class('glance::registry').with(