Add nonblocking_notify to Swift proxy ceilometer config

This allows to send Ceilometer notifications in a background thread, no
longer blocking Swift proxy if the RabbitMQ is not available.

This patch does not change the default behavior.

Change-Id: Iad1f69f273fe80176c6010f8f3cc24313d7c5ab4
This commit is contained in:
Christian Schwede 2016-10-31 23:01:23 +01:00
parent 93ca5cd6c5
commit 49a4be7277
3 changed files with 20 additions and 0 deletions

View File

@ -54,6 +54,10 @@
# ceilometer/wsgi: set $::apache::group
# Defaults to 'ceilometer'
#
# [*nonblocking_notify*]
# Whether to send events to messaging driver in a background thread
# Defaults to false
#
# == Examples
#
# == Authors
@ -76,6 +80,7 @@ class swift::proxy::ceilometer(
$control_exchange = undef,
$ensure = 'present',
$group = 'ceilometer',
$nonblocking_notify = false,
) inherits swift {
include ::swift::deps
@ -113,6 +118,7 @@ class swift::proxy::ceilometer(
'filter:ceilometer/url': value => $url;
'filter:ceilometer/control_exchange': value => $control_exchange;
'filter:ceilometer/paste.filter_factory': value => 'ceilometermiddleware.swift:filter_factory';
'filter:ceilometer/nonblocking_notify': value => $nonblocking_notify;
}
package { 'python-ceilometermiddleware':

View File

@ -0,0 +1,10 @@
---
features:
- A new ceilometermiddleware option "nonblocking_notify" has been
added and can be used to send notifications in a separate background
thread. This avoids blocking of Swift if RabbitMQ is not able to
process new notifications. In this case notifications will be
dropped after the local queue (defaults to 1000 entries) is
exhausted. It requires the Newton release of ceilometermiddleware.
This option is disabled by default and not changing the current
behavior.

View File

@ -16,6 +16,7 @@ describe 'swift::proxy::ceilometer' do
describe "when using default parameters" do
it { is_expected.to contain_swift_proxy_config('filter:ceilometer/paste.filter_factory').with_value('ceilometermiddleware.swift:filter_factory') }
it { is_expected.to contain_swift_proxy_config('filter:ceilometer/url').with_value('rabbit://guest:guest@127.0.0.1:5672//') }
it { is_expected.to contain_swift_proxy_config('filter:ceilometer/nonblocking_notify').with_value('false') }
it { is_expected.to contain_user('swift').with_groups('ceilometer') }
it { is_expected.to contain_file('/var/log/ceilometer/swift-proxy-server.log').with(:owner => 'swift', :group => 'swift', :mode => '0664') }
end
@ -31,6 +32,7 @@ describe 'swift::proxy::ceilometer' do
:driver => 'messagingv2',
:topic => 'notifications',
:control_exchange => 'swift',
:nonblocking_notify => true,
}
end
@ -41,6 +43,7 @@ describe 'swift::proxy::ceilometer' do
it { is_expected.to contain_swift_proxy_config('filter:ceilometer/driver').with_value('messagingv2') }
it { is_expected.to contain_swift_proxy_config('filter:ceilometer/topic').with_value('notifications') }
it { is_expected.to contain_swift_proxy_config('filter:ceilometer/control_exchange').with_value('swift') }
it { is_expected.to contain_swift_proxy_config('filter:ceilometer/nonblocking_notify').with_value('true') }
end
context 'with multiple rabbit hosts' do
@ -54,6 +57,7 @@ describe 'swift::proxy::ceilometer' do
it { is_expected.to contain_swift_proxy_config('filter:ceilometer/driver').with_value('messagingv2') }
it { is_expected.to contain_swift_proxy_config('filter:ceilometer/topic').with_value('notifications') }
it { is_expected.to contain_swift_proxy_config('filter:ceilometer/control_exchange').with_value('swift') }
it { is_expected.to contain_swift_proxy_config('filter:ceilometer/nonblocking_notify').with_value('true') }
end
end