diff --git a/manifests/guestagent.pp b/manifests/guestagent.pp index 8b1d1cd0..ac8751c7 100644 --- a/manifests/guestagent.pp +++ b/manifests/guestagent.pp @@ -152,6 +152,7 @@ trove::control_exchange instead.") oslo::messaging::rabbit {'trove_guestagent_config': rabbit_use_ssl => $rabbit_use_ssl, rabbit_ha_queues => $::trove::rabbit_ha_queues, + heartbeat_in_pthread => $::trove::rabbit_heartbeat_in_pthread, kombu_reconnect_delay => $::trove::kombu_reconnect_delay, kombu_failover_strategy => $::trove::kombu_failover_strategy, amqp_durable_queues => $::trove::amqp_durable_queues, diff --git a/manifests/init.pp b/manifests/init.pp index cfab1168..a9841208 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -73,6 +73,16 @@ # (optional) Use HA queues in RabbitMQ (x-ha-policy: all). # 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_reconnect_delay*] # (optional) How long to wait before reconnecting in response to an AMQP # consumer cancel notification. @@ -293,6 +303,7 @@ class trove( $rabbit_use_ssl = $::os_service_default, $rabbit_ha_queues = $::os_service_default, $rabbit_notification_topic = $::os_service_default, + $rabbit_heartbeat_in_pthread = $::os_service_default, $kombu_ssl_ca_certs = $::os_service_default, $kombu_ssl_certfile = $::os_service_default, $kombu_ssl_keyfile = $::os_service_default, diff --git a/releasenotes/notes/rabbitmq-heartbeat-over-pthread-93fe3506ae120580.yaml b/releasenotes/notes/rabbitmq-heartbeat-over-pthread-93fe3506ae120580.yaml new file mode 100644 index 00000000..496d2279 --- /dev/null +++ b/releasenotes/notes/rabbitmq-heartbeat-over-pthread-93fe3506ae120580.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/trove_guestagent_spec.rb b/spec/classes/trove_guestagent_spec.rb index fa091622..5cc5f87a 100644 --- a/spec/classes/trove_guestagent_spec.rb +++ b/spec/classes/trove_guestagent_spec.rb @@ -41,6 +41,7 @@ describe 'trove::guestagent' do is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('') is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_failover_strategy').with_value('') is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('') + is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/heartbeat_in_pthread').with_value('') is_expected.to contain_trove_guestagent_config('DEFAULT/swift_url').with_value('') is_expected.to contain_trove_guestagent_config('DEFAULT/swift_service_type').with_value('') is_expected.to contain_trove_guestagent_config('DEFAULT/root_grant').with_value('') @@ -73,13 +74,15 @@ describe 'trove::guestagent' do context 'when using a single RabbitMQ server with enable ha options' do let :pre_condition do "class { 'trove': - nova_proxy_admin_pass => 'verysecrete', - rabbit_ha_queues => 'true', - amqp_durable_queues => 'true', + nova_proxy_admin_pass => 'verysecrete', + rabbit_ha_queues => 'true', + rabbit_heartbeat_in_pthread => 'true', + amqp_durable_queues => 'true', }" end it 'configures trove-api with RabbitMQ' do is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('true') + is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/heartbeat_in_pthread').with_value('true') is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('true') end end