Currently we use the following command to determine if rabbit is
up and running *and* ready to service requests:
rabbitmqctl eval "rabbit_mnesia:is_clustered()." | grep -q true
Now we have occasionally observed that rabbitmqctl policies commands
which are executed after said exec['rabbitmq-ready'] will fail.
One potential reason is that is_clustered() can return true *before*
the rabbit app is actually running. In fact we can see it does
return true even though the app is stopped:
()[root@controller-1 /]$ rabbitmqctl stop_app
Stopping rabbit application on node rabbit@controller-1 ...
()[root@controller-1 /]$ rabbitmqctl eval 'rabbit_mnesia:is_clustered().'
true
Let's switch to a combination of commands that check for the cluster to
be up *and* the rabbitmq app to be running:
()[root@controller-1 /]$ rabbitmqctl stop_app
Stopping rabbit application on node rabbit@controller-1 ...
()[root@controller-1 /]$ rabbitmqctl eval 'rabbit_nodes:is_running(node(), rabbit).'
false
Reviewed: https:/ /review. opendev. org/677406 /git.openstack. org/cgit/ openstack/ puppet- tripleo/ commit/ ?id=051e05a91dc 89021de45644a8a 34ffb93c2ddce7
Committed: https:/
Submitter: Zuul
Branch: stable/queens
commit 051e05a91dc8902 1de45644a8a34ff b93c2ddce7
Author: Michele Baldessari <email address hidden>
Date: Wed Aug 14 16:40:46 2019 +0200
Make the rabbitmq-ready exec more stringent
Currently we use the following command to determine if rabbit is mnesia: is_clustered( )." | grep -q true
up and running *and* ready to service requests:
rabbitmqctl eval "rabbit_
Now we have occasionally observed that rabbitmqctl policies commands ready'] will fail.
which are executed after said exec['rabbitmq-
One potential reason is that is_clustered() can return true *before* root@controller -1 /]$ rabbitmqctl stop_app root@controller -1 /]$ rabbitmqctl eval 'rabbit_ mnesia: is_clustered( ).'
the rabbit app is actually running. In fact we can see it does
return true even though the app is stopped:
()[
Stopping rabbit application on node rabbit@controller-1 ...
()[
true
Let's switch to a combination of commands that check for the cluster to root@controller -1 /]$ rabbitmqctl stop_app root@controller -1 /]$ rabbitmqctl eval 'rabbit_ nodes:is_ running( node(), rabbit).'
be up *and* the rabbitmq app to be running:
()[
Stopping rabbit application on node rabbit@controller-1 ...
()[
false
Suggested-By: Bogdan Dobrelya <email address hidden>
Closes-Bug: #1835615
Change-Id: I29f779145a39cd 16374a91626f7fa e1581a18224