From 4e2c15e76383ac5f27c7733e986e1420d33bf3fe 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: If5cb4855e20fe9553b4a4a0d787918923a4334ba Closes-Bug: #1840868 --- manifests/init.pp | 12 ++++++++++++ ...itmq-heartbeat-over-pthread-a3c353553e9014ab.yaml | 6 ++++++ spec/classes/keystone_init_spec.rb | 3 +++ 3 files changed, 21 insertions(+) create mode 100644 releasenotes/notes/rabbitmq-heartbeat-over-pthread-a3c353553e9014ab.yaml diff --git a/manifests/init.pp b/manifests/init.pp index 9f9260406..0903c9da4 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -190,6 +190,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 +# # [*rabbit_use_ssl*] # (Optional) Connect over SSL for RabbitMQ # Defaults to $::os_serice_default @@ -632,6 +642,7 @@ class keystone( $database_max_overflow = undef, $rabbit_heartbeat_timeout_threshold = $::os_service_default, $rabbit_heartbeat_rate = $::os_service_default, + $rabbit_heartbeat_in_pthread = $::os_service_default, $rabbit_use_ssl = $::os_service_default, $default_transport_url = $::os_service_default, $rabbit_ha_queues = $::os_service_default, @@ -890,6 +901,7 @@ admin_token will be removed in a later release") rabbit_ha_queues => $rabbit_ha_queues, heartbeat_timeout_threshold => $rabbit_heartbeat_timeout_threshold, heartbeat_rate => $rabbit_heartbeat_rate, + heartbeat_in_pthread => $rabbit_heartbeat_in_pthread, amqp_durable_queues => $amqp_durable_queues, } diff --git a/releasenotes/notes/rabbitmq-heartbeat-over-pthread-a3c353553e9014ab.yaml b/releasenotes/notes/rabbitmq-heartbeat-over-pthread-a3c353553e9014ab.yaml new file mode 100644 index 000000000..496d2279e --- /dev/null +++ b/releasenotes/notes/rabbitmq-heartbeat-over-pthread-a3c353553e9014ab.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/keystone_init_spec.rb b/spec/classes/keystone_init_spec.rb index 517b466f1..62eea8813 100644 --- a/spec/classes/keystone_init_spec.rb +++ b/spec/classes/keystone_init_spec.rb @@ -50,6 +50,7 @@ describe 'keystone' do 'notification_transport_url' => '', 'rabbit_heartbeat_timeout_threshold' => '', 'rabbit_heartbeat_rate' => '', + 'rabbit_heartbeat_in_pthread' => '', 'amqp_durable_queues' => '', 'admin_workers' => 20, 'public_workers' => 20, @@ -90,6 +91,7 @@ describe 'keystone' do 'notification_transport_url' => 'rabbit://user:pass@host:1234/virt', 'rabbit_heartbeat_timeout_threshold' => '60', 'rabbit_heartbeat_rate' => '10', + 'rabbit_heartbeat_in_pthread' => true, 'rabbit_ha_queues' => true, 'amqp_durable_queues' => true, 'default_domain' => 'other_domain', @@ -208,6 +210,7 @@ describe 'keystone' do it 'should contain correct rabbit heartbeat configuration' do is_expected.to contain_keystone_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value(param_hash['rabbit_heartbeat_timeout_threshold']) is_expected.to contain_keystone_config('oslo_messaging_rabbit/heartbeat_rate').with_value(param_hash['rabbit_heartbeat_rate']) + is_expected.to contain_keystone_config('oslo_messaging_rabbit/heartbeat_in_pthread').with_value(param_hash['rabbit_heartbeat_in_pthread']) is_expected.to contain_keystone_config('oslo_messaging_rabbit/amqp_durable_queues').with_value(param_hash['amqp_durable_queues']) end