From 2f6516755acfa346c49e19f9e95a04afa82e47be Mon Sep 17 00:00:00 2001 From: Mark Vanderwiel Date: Fri, 5 Jun 2015 12:05:10 -0500 Subject: [PATCH] Allow oslo rabbit heartbeat configuration In order to allow components to better handle and respond to mq failures, oslo has some heartbeat options that are useful. Change-Id: I41b3fc4699a4f285e9fcb066da55bb8a7f1361a2 Partial-Bug: #1462438 --- spec/spec_helper.rb | 4 +++- templates/default/glance-api.conf.erb | 6 ++++++ templates/default/glance-registry.conf.erb | 6 ++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 1cf8400..2a7e13b 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -239,7 +239,9 @@ shared_examples 'messaging' do it 'has RPC/AMQP defaults set' do [/^amqp_durable_queues=false$/, - /^amqp_auto_delete=false$/].each do |line| + /^amqp_auto_delete=false$/, + /^heartbeat_timeout_threshold=0$/, + /^heartbeat_rate=2$/].each do |line| expect(chef_run).to render_file(file_name).with_content(line) end end diff --git a/templates/default/glance-api.conf.erb b/templates/default/glance-api.conf.erb index 772a922..2f311c9 100644 --- a/templates/default/glance-api.conf.erb +++ b/templates/default/glance-api.conf.erb @@ -783,6 +783,12 @@ qpid_topology_version=<%= node["openstack"]["mq"]["image"]["qpid"]["topology_ver <% if @notification_driver == "messaging" && @mq_service_type == "rabbitmq" %> +# Number of seconds after which the Rabbit broker is considered down if heartbeat's keep-alive fails (0 disable the heartbeat) +heartbeat_timeout_threshold=<%= node['openstack']['mq']['image']['rabbit']['heartbeat_timeout_threshold'] %> + +# How often times during the heartbeat_timeout_threshold we check the heartbeat +heartbeat_rate=<%= node['openstack']['mq']['image']['rabbit']['heartbeat_rate'] %> + # Use durable queues in AMQP. (boolean value) # Deprecated group/name - [DEFAULT]/rabbit_durable_queues amqp_durable_queues=<%= node["openstack"]["mq"]["image"]["durable_queues"] %> diff --git a/templates/default/glance-registry.conf.erb b/templates/default/glance-registry.conf.erb index 1ba5862..78cd758 100644 --- a/templates/default/glance-registry.conf.erb +++ b/templates/default/glance-registry.conf.erb @@ -316,6 +316,12 @@ qpid_topology_version=<%= node["openstack"]["mq"]["image"]["qpid"]["topology_ver <% if @notification_driver == "messaging" && @mq_service_type == "rabbitmq" %> +# Number of seconds after which the Rabbit broker is considered down if heartbeat's keep-alive fails (0 disable the heartbeat) +heartbeat_timeout_threshold=<%= node['openstack']['mq']['image']['rabbit']['heartbeat_timeout_threshold'] %> + +# How often times during the heartbeat_timeout_threshold we check the heartbeat +heartbeat_rate=<%= node['openstack']['mq']['image']['rabbit']['heartbeat_rate'] %> + # Use durable queues in AMQP. (boolean value) # Deprecated group/name - [DEFAULT]/rabbit_durable_queues amqp_durable_queues=<%= node["openstack"]["mq"]["image"]["durable_queues"] %>