From a84a1443391db5da3161790d92bb8256fd7f5d6b Mon Sep 17 00:00:00 2001 From: Mark Vanderwiel Date: Fri, 5 Jun 2015 12:13:57 -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: I453b04c90e6caba7c00cf239035af05199bb5c36 Partial-Bug: #1462438 --- spec/spec_helper.rb | 11 +++++++++++ templates/default/heat.conf.erb | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 19f558b..b9bcaf3 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -404,6 +404,17 @@ shared_examples 'expects to create heat conf' do node.set['openstack']['mq']['orchestration']['service_type'] = 'rabbitmq' end + it 'has default rabbit values' do + [/^rpc_conn_pool_size=30$/, + /^amqp_durable_queues=false$/, + /^amqp_auto_delete=false$/, + /^heartbeat_timeout_threshold=0$/, + /^heartbeat_rate=2$/ + ].each do |line| + expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', line) + end + end + it 'does not have rabbit ha values' do [ /^rabbit_host=127.0.0.1$/, diff --git a/templates/default/heat.conf.erb b/templates/default/heat.conf.erb index f86fffa..0176617 100644 --- a/templates/default/heat.conf.erb +++ b/templates/default/heat.conf.erb @@ -1345,6 +1345,12 @@ qpid_reconnect_interval=<%= node["openstack"]["mq"]["orchestration"]["qpid"]["re <% if @mq_service_type == "rabbitmq" %> [oslo_messaging_rabbit] +# 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']['orchestration']['rabbit']['heartbeat_timeout_threshold'] %> + +# How often times during the heartbeat_timeout_threshold we check the heartbeat +heartbeat_rate=<%= node['openstack']['mq']['orchestration']['rabbit']['heartbeat_rate'] %> + # Use durable queues in amqp. (boolean value) # Deprecated group/name - [DEFAULT]/rabbit_durable_queues amqp_durable_queues=<%= node['openstack']['mq']['orchestration']['durable_queues'] %>