Skip to content

Commit 71cf53a

Browse files
committed
Set the rabbit_durable_queues to match local consumers
Due to a problematic bug in Glance (https://bugs.launchpad.net/glance/+bug/1074132), I was unable to get stack.sh to complete successfully. The workaround on the Glance bug was to set the rabbit_durable_queues value to match the setting of the local Rabbit consumers and exchanges. This patch merely looks for any consumer or exchange that is durable and ensures that the default durable_rabbit_queues config option of False is set to True in that case. Change-Id: Ia5a165a5a06d11d1fe6492ca32139972d49d3a1e
1 parent c7ac694 commit 71cf53a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/glance

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ function configure_glanceclient() {
7070
setup_develop $GLANCECLIENT_DIR
7171
}
7272

73+
# durable_glance_queues() - Determine if RabbitMQ queues are durable or not
74+
function durable_glance_queues() {
75+
test `rabbitmqctl list_queues name durable | grep true | wc -l` -gt 0 && return 0
76+
test `rabbitmqctl list_exchanges name durable | grep true | wc -l` -gt 0 && return 0
77+
return 1
78+
}
79+
7380
# configure_glance() - Set config files, create data dirs, etc
7481
function configure_glance() {
7582
setup_develop $GLANCE_DIR
@@ -120,6 +127,12 @@ function configure_glance() {
120127
iniset $GLANCE_API_CONF DEFAULT notifier_strategy rabbit
121128
iniset $GLANCE_API_CONF DEFAULT rabbit_host $RABBIT_HOST
122129
iniset $GLANCE_API_CONF DEFAULT rabbit_password $RABBIT_PASSWORD
130+
if [[ durable_glance_queues -eq 0 ]]; then
131+
# This gets around https://bugs.launchpad.net/glance/+bug/1074132
132+
# that results in a g-api server becoming unresponsive during
133+
# startup...
134+
iniset $GLANCE_API_CONF DEFAULT rabbit_durable_queues True
135+
fi
123136
fi
124137
if [[ "$KEYSTONE_TOKEN_FORMAT" == "PKI" ]]; then
125138
iniset $GLANCE_API_CONF keystone_authtoken signing_dir $GLANCE_AUTH_CACHE_DIR/api

0 commit comments

Comments
 (0)