diff --git a/manifests/init.pp b/manifests/init.pp index 7bb52dc8..dd1f3105 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -116,6 +116,16 @@ # (Optional) Backoff between reconnection attempts for rabbit. # 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 +# # [*kombu_ssl_version*] # (optional) SSL version to use (valid only if SSL enabled). # Valid values are TLSv1, SSLv23 and SSLv3. SSLv2 may be @@ -277,6 +287,7 @@ class sahara( $rabbit_login_method = $::os_service_default, $rabbit_retry_interval = $::os_service_default, $rabbit_retry_backoff = $::os_service_default, + $rabbit_heartbeat_in_pthread = $::os_service_default, $kombu_ssl_version = $::os_service_default, $kombu_ssl_keyfile = $::os_service_default, $kombu_ssl_certfile = $::os_service_default, @@ -354,6 +365,7 @@ class sahara( rabbit_login_method => $rabbit_login_method, rabbit_retry_interval => $rabbit_retry_interval, rabbit_retry_backoff => $rabbit_retry_backoff, + heartbeat_in_pthread => $rabbit_heartbeat_in_pthread, } oslo::messaging::amqp { 'sahara_config': diff --git a/releasenotes/notes/rabbitmq-heartbeat-over-pthread-92b1a2b083a55f71.yaml b/releasenotes/notes/rabbitmq-heartbeat-over-pthread-92b1a2b083a55f71.yaml new file mode 100644 index 00000000..496d2279 --- /dev/null +++ b/releasenotes/notes/rabbitmq-heartbeat-over-pthread-92b1a2b083a55f71.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/sahara_init_spec.rb b/spec/classes/sahara_init_spec.rb index ff1b80e7..59d769ce 100644 --- a/spec/classes/sahara_init_spec.rb +++ b/spec/classes/sahara_init_spec.rb @@ -35,6 +35,7 @@ describe 'sahara' do it { is_expected.to contain_sahara_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('') } it { is_expected.to contain_sahara_config('oslo_messaging_rabbit/kombu_compression').with_value('') } it { is_expected.to contain_sahara_config('oslo_messaging_rabbit/kombu_failover_strategy').with_value('') } + it { is_expected.to contain_sahara_config('oslo_messaging_rabbit/heartbeat_in_pthread').with_value('') } it { is_expected.to contain_sahara_config('DEFAULT/transport_url').with_value('') } it { is_expected.to contain_sahara_config('DEFAULT/control_exchange').with_value('') } it { is_expected.to contain_sahara_config('DEFAULT/rpc_response_timeout').with_value('') } @@ -73,16 +74,18 @@ describe 'sahara' do context 'when passing params' do before do params.merge!({ - :rabbit_ha_queues => 'true', - :amqp_durable_queues => 'true', - :kombu_reconnect_delay => '1.0', - :kombu_compression => 'gzip', - :kombu_failover_strategy => 'round-robin', + :rabbit_ha_queues => 'true', + :amqp_durable_queues => 'true', + :rabbit_heartbeat_in_pthread => 'true', + :kombu_reconnect_delay => '1.0', + :kombu_compression => 'gzip', + :kombu_failover_strategy => 'round-robin', }) end it { is_expected.to contain_sahara_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('true') } it { is_expected.to contain_sahara_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('true') } + it { is_expected.to contain_sahara_config('oslo_messaging_rabbit/heartbeat_in_pthread').with_value('true') } it { is_expected.to contain_sahara_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('1.0') } it { is_expected.to contain_sahara_config('oslo_messaging_rabbit/kombu_compression').with_value('gzip') } it { is_expected.to contain_sahara_config('oslo_messaging_rabbit/kombu_failover_strategy').with_value('round-robin') }