From b3471b1b931dc9a1ef20bacc7cff808334e34228 Mon Sep 17 00:00:00 2001 From: ZhongShengping Date: Wed, 21 Aug 2019 14:21:00 +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: I3debab140115a91f3df7aabf00c87eb1842b293b Closes-Bug: #1840868 --- manifests/api.pp | 12 ++++++++++++ ...itmq-heartbeat-over-pthread-854a6ff08efbcf52.yaml | 6 ++++++ spec/classes/barbican_api_spec.rb | 3 +++ 3 files changed, 21 insertions(+) create mode 100644 releasenotes/notes/rabbitmq-heartbeat-over-pthread-854a6ff08efbcf52.yaml diff --git a/manifests/api.pp b/manifests/api.pp index 77e8bcd5..9987f597 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -86,6 +86,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 +# # [*amqp_durable_queues*] # (optional) Define queues as "durable" to rabbitmq. # Defaults to $::os_service_default @@ -258,6 +268,7 @@ class barbican::api ( $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, $amqp_durable_queues = $::os_service_default, $enable_queue = $::os_service_default, @@ -334,6 +345,7 @@ class barbican::api ( 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-854a6ff08efbcf52.yaml b/releasenotes/notes/rabbitmq-heartbeat-over-pthread-854a6ff08efbcf52.yaml new file mode 100644 index 00000000..496d2279 --- /dev/null +++ b/releasenotes/notes/rabbitmq-heartbeat-over-pthread-854a6ff08efbcf52.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/barbican_api_spec.rb b/spec/classes/barbican_api_spec.rb index e2c351be..4d32c480 100644 --- a/spec/classes/barbican_api_spec.rb +++ b/spec/classes/barbican_api_spec.rb @@ -36,6 +36,7 @@ describe 'barbican::api' do :rabbit_use_ssl => '', :rabbit_heartbeat_timeout_threshold => '', :rabbit_heartbeat_rate => '', + :rabbit_heartbeat_in_pthread => '', :rabbit_ha_queues => '', :amqp_durable_queues => '', :max_allowed_secret_in_bytes => '', @@ -80,6 +81,7 @@ describe 'barbican::api' do :rabbit_use_ssl => true, :rabbit_heartbeat_timeout_threshold => '10', :rabbit_heartbeat_rate => '10', + :rabbit_heartbeat_in_pthread => true, :rabbit_ha_queues => true, :amqp_durable_queues => true, :enable_queue => true, @@ -163,6 +165,7 @@ describe 'barbican::api' do is_expected.to contain_barbican_config('oslo_messaging_notifications/topics').with_value(param_hash[:notification_topics]) is_expected.to contain_barbican_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value(param_hash[:rabbit_heartbeat_timeout_threshold]) is_expected.to contain_barbican_config('oslo_messaging_rabbit/heartbeat_rate').with_value(param_hash[:rabbit_heartbeat_rate]) + is_expected.to contain_barbican_config('oslo_messaging_rabbit/heartbeat_in_pthread').with_value(param_hash[:rabbit_heartbeat_in_pthread]) is_expected.to contain_oslo__messaging__rabbit('barbican_config').with( :rabbit_use_ssl => true, :kombu_ssl_ca_certs => 'path_to_certs',