diff --git a/manifests/init.pp b/manifests/init.pp index a6df7328..e42d34ae 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -41,6 +41,16 @@ # every 30 seconds. # Defaults to $::os_service_default # +# [*rabbit_heartbeat_in_pthread*] +# (Optional) EXPERIMENTAL: Run the health check heartbeat thread +# through a native python thread. By default if this +# option isn't provided the health check heartbeat will +# inherit the execution model from the parent process. By +# example if the parent process have monkey patched the +# stdlib by using eventlet/greenlet then the heartbeat +# will be run through a green thread. +# Defaults to $::os_service_default +# # [*rabbit_use_ssl*] # (optional) Connect over SSL for RabbitMQ # Defaults to $::os_service_default @@ -253,6 +263,7 @@ class cinder ( $rabbit_ha_queues = $::os_service_default, $rabbit_heartbeat_timeout_threshold = $::os_service_default, $rabbit_heartbeat_rate = $::os_service_default, + $rabbit_heartbeat_in_pthread = $::os_service_default, $rabbit_use_ssl = $::os_service_default, $service_down_time = $::os_service_default, $report_interval = $::os_service_default, @@ -311,6 +322,7 @@ class cinder ( rabbit_ha_queues => $rabbit_ha_queues, heartbeat_timeout_threshold => $rabbit_heartbeat_timeout_threshold, heartbeat_rate => $rabbit_heartbeat_rate, + heartbeat_in_pthread => $rabbit_heartbeat_in_pthread, rabbit_use_ssl => $rabbit_use_ssl, kombu_reconnect_delay => $kombu_reconnect_delay, kombu_failover_strategy => $kombu_failover_strategy, diff --git a/releasenotes/notes/rabbitmq-heartbeat-over-pthread-a37f57a835c6291b.yaml b/releasenotes/notes/rabbitmq-heartbeat-over-pthread-a37f57a835c6291b.yaml new file mode 100644 index 00000000..496d2279 --- /dev/null +++ b/releasenotes/notes/rabbitmq-heartbeat-over-pthread-a37f57a835c6291b.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Allow users to run the RabbitMQ heartbeat over a native python thread in the + oslo.messaging RabbitMQ driver, by using the `rabbit_heartbeat_in_pthread` + option in configuration. diff --git a/spec/classes/cinder_init_spec.rb b/spec/classes/cinder_init_spec.rb index 20caae72..66aead30 100644 --- a/spec/classes/cinder_init_spec.rb +++ b/spec/classes/cinder_init_spec.rb @@ -28,6 +28,7 @@ describe 'cinder' do is_expected.to contain_cinder_config('oslo_messaging_rabbit/rabbit_ha_queues').with(:value => '') is_expected.to contain_cinder_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('') is_expected.to contain_cinder_config('oslo_messaging_rabbit/heartbeat_rate').with_value('') + is_expected.to contain_cinder_config('oslo_messaging_rabbit/heartbeat_in_pthread').with_value('') is_expected.to contain_cinder_config('oslo_messaging_rabbit/kombu_reconnect_delay').with(:value => '') is_expected.to contain_cinder_config('oslo_messaging_rabbit/kombu_failover_strategy').with(:value => '') is_expected.to contain_cinder_config('oslo_messaging_rabbit/kombu_compression').with(:value => '') @@ -55,11 +56,13 @@ describe 'cinder' do context 'with rabbitmq heartbeats' do let :params do req_params.merge( :rabbit_heartbeat_timeout_threshold => '60', - :rabbit_heartbeat_rate => '10' ) + :rabbit_heartbeat_rate => '10', + :rabbit_heartbeat_in_pthread => true ) end it { is_expected.to contain_cinder_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('60') } it { is_expected.to contain_cinder_config('oslo_messaging_rabbit/heartbeat_rate').with_value('10') } + it { is_expected.to contain_cinder_config('oslo_messaging_rabbit/heartbeat_in_pthread').with_value(true) } end context 'with SSL enabled with kombu' do