diff --git a/manifests/init.pp b/manifests/init.pp index b74ec0b..8be77b8 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -59,6 +59,16 @@ # check the heartbeat. # 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_ha_queues*] # (optional) Use HA queues in RabbitMQ (x-ha-policy: all). If you change this # option, you must wipe the RabbitMQ database. @@ -312,6 +322,7 @@ class watcher ( $rabbit_interval_max = $::os_service_default, $rabbit_use_ssl = $::os_service_default, $rabbit_heartbeat_rate = $::os_service_default, + $rabbit_heartbeat_in_pthread = $::os_service_default, $rabbit_ha_queues = $::os_service_default, $rabbit_transient_queues_ttl = $::os_service_default, $rabbit_heartbeat_timeout_threshold = $::os_service_default, @@ -409,6 +420,7 @@ class watcher ( rabbit_transient_queues_ttl => $rabbit_transient_queues_ttl, heartbeat_timeout_threshold => $rabbit_heartbeat_timeout_threshold, heartbeat_rate => $rabbit_heartbeat_rate, + heartbeat_in_pthread => $rabbit_heartbeat_in_pthread, } oslo::messaging::amqp { 'watcher_config': diff --git a/releasenotes/notes/rabbitmq-heartbeat-over-pthread-a074c263f0b7469d.yaml b/releasenotes/notes/rabbitmq-heartbeat-over-pthread-a074c263f0b7469d.yaml new file mode 100644 index 0000000..496d227 --- /dev/null +++ b/releasenotes/notes/rabbitmq-heartbeat-over-pthread-a074c263f0b7469d.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/watcher_init_spec.rb b/spec/classes/watcher_init_spec.rb index 5ac4be0..f8ac562 100644 --- a/spec/classes/watcher_init_spec.rb +++ b/spec/classes/watcher_init_spec.rb @@ -34,6 +34,7 @@ describe 'watcher' do is_expected.to contain_watcher_config('oslo_messaging_rabbit/rabbit_transient_queues_ttl').with_value('') is_expected.to contain_watcher_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('') is_expected.to contain_watcher_config('oslo_messaging_rabbit/heartbeat_rate').with_value('') + is_expected.to contain_watcher_config('oslo_messaging_rabbit/heartbeat_in_pthread').with_value('') is_expected.to contain_watcher_config('oslo_messaging_rabbit/kombu_compression').with_value('') is_expected.to contain_watcher_config('DEFAULT/transport_url').with_value('') is_expected.to contain_watcher_config('DEFAULT/rpc_response_timeout').with_value('') @@ -58,6 +59,7 @@ describe 'watcher' do :rabbit_ha_queues => 'undef', :rabbit_heartbeat_timeout_threshold => '60', :rabbit_heartbeat_rate => '10', + :rabbit_heartbeat_in_pthread => true, :kombu_compression => 'gzip', :notification_transport_url => 'rabbit://rabbit_user:password@localhost:5673', :notification_topics => 'notifications', @@ -68,6 +70,7 @@ describe 'watcher' do is_expected.to contain_watcher_config('DEFAULT/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673') is_expected.to contain_watcher_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('60') is_expected.to contain_watcher_config('oslo_messaging_rabbit/heartbeat_rate').with_value('10') + is_expected.to contain_watcher_config('oslo_messaging_rabbit/heartbeat_in_pthread').with_value(true) is_expected.to contain_watcher_config('oslo_messaging_rabbit/rabbit_login_method').with_value('') is_expected.to contain_watcher_config('oslo_messaging_rabbit/rabbit_retry_interval').with_value('') is_expected.to contain_watcher_config('oslo_messaging_rabbit/rabbit_retry_backoff').with_value('')