From 75504111d5f3a4c0ec62e8ec7ba0cafe434c25d8 Mon Sep 17 00:00:00 2001 From: ZhongShengping Date: Wed, 21 Aug 2019 14:21:01 +0800 Subject: [PATCH] Introduce the new rabbit_heartbeat_in_pthread option oslo.messaging RabbitMQ driver have now a new option that allow user to run the RabbitMQ heartbeat over a native python thread. These change allow user to use this new option. Change-Id: Ica6cdc200d3f736573a0b78c8163e1c17567b3ef Closes-Bug: #1840868 --- manifests/init.pp | 12 ++++++++++++ ...itmq-heartbeat-over-pthread-9b65893bf0406753.yaml | 6 ++++++ spec/classes/nova_init_spec.rb | 3 +++ 3 files changed, 21 insertions(+) create mode 100644 releasenotes/notes/rabbitmq-heartbeat-over-pthread-9b65893bf0406753.yaml diff --git a/manifests/init.pp b/manifests/init.pp index 23da3423b..dd9885d44 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -92,6 +92,16 @@ # the heartbeat will be checked every 30 seconds. (integer value) # 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_ca_certs*] # (optional) SSL certification authority file (valid only if SSL enabled). # (string value) @@ -436,6 +446,7 @@ class nova( $rabbit_use_ssl = $::os_service_default, $rabbit_heartbeat_timeout_threshold = $::os_service_default, $rabbit_heartbeat_rate = $::os_service_default, + $rabbit_heartbeat_in_pthread = $::os_service_default, $rabbit_ha_queues = $::os_service_default, $kombu_ssl_ca_certs = $::os_service_default, $kombu_ssl_certfile = $::os_service_default, @@ -639,6 +650,7 @@ but should be one of: ssh-rsa, ssh-dsa, ssh-ecdsa.") rabbit_use_ssl => $rabbit_use_ssl, heartbeat_timeout_threshold => $rabbit_heartbeat_timeout_threshold, heartbeat_rate => $rabbit_heartbeat_rate, + heartbeat_in_pthread => $rabbit_heartbeat_in_pthread, kombu_reconnect_delay => $kombu_reconnect_delay, kombu_failover_strategy => $kombu_failover_strategy, amqp_durable_queues => $amqp_durable_queues, diff --git a/releasenotes/notes/rabbitmq-heartbeat-over-pthread-9b65893bf0406753.yaml b/releasenotes/notes/rabbitmq-heartbeat-over-pthread-9b65893bf0406753.yaml new file mode 100644 index 000000000..496d2279e --- /dev/null +++ b/releasenotes/notes/rabbitmq-heartbeat-over-pthread-9b65893bf0406753.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/nova_init_spec.rb b/spec/classes/nova_init_spec.rb index c504cec51..66f7b17b5 100644 --- a/spec/classes/nova_init_spec.rb +++ b/spec/classes/nova_init_spec.rb @@ -40,6 +40,7 @@ describe 'nova' do is_expected.to contain_nova_config('DEFAULT/transport_url').with_value('') is_expected.to contain_nova_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('') is_expected.to contain_nova_config('oslo_messaging_rabbit/heartbeat_rate').with_value('') + is_expected.to contain_nova_config('oslo_messaging_rabbit/heartbeat_in_pthread').with_value('') end it 'configures various things' do @@ -79,6 +80,7 @@ describe 'nova' do :control_exchange => 'nova', :rabbit_heartbeat_timeout_threshold => '60', :rabbit_heartbeat_rate => '10', + :rabbit_heartbeat_in_pthread => true, :lock_path => '/var/locky/path', :state_path => '/var/lib/nova2', :service_down_time => '120', @@ -137,6 +139,7 @@ describe 'nova' do is_expected.to contain_nova_config('DEFAULT/control_exchange').with_value('nova') is_expected.to contain_nova_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('60') is_expected.to contain_nova_config('oslo_messaging_rabbit/heartbeat_rate').with_value('10') + is_expected.to contain_nova_config('oslo_messaging_rabbit/heartbeat_in_pthread').with_value(true) end it 'configures host' do