Merge "Change the restart_rpc_backend loop to accomodate async rabbitmq"

This commit is contained in:
Jenkins 2015-06-05 00:13:08 +00:00 committed by Gerrit Code Review
commit 62bc560bd8

View File

@ -194,13 +194,22 @@ function restart_rpc_backend {
# NOTE(bnemec): Retry initial rabbitmq configuration to deal with # NOTE(bnemec): Retry initial rabbitmq configuration to deal with
# the fact that sometimes it fails to start properly. # the fact that sometimes it fails to start properly.
# Reference: https://bugzilla.redhat.com/show_bug.cgi?id=1144100 # Reference: https://bugzilla.redhat.com/show_bug.cgi?id=1144100
# NOTE(tonyb): Extend the orginal retry logic to only restart rabbitmq
# every second time around the loop.
# See: https://bugs.launchpad.net/devstack/+bug/1449056 for details on
# why this is needed. This can bee seen on vivid and Debian unstable
# (May 2015)
# TODO(tonyb): Remove this when Debian and Ubuntu have a fixed systemd
# service file.
local i local i
for i in `seq 10`; do for i in `seq 20`; do
local rc=0 local rc=0
[[ $i -eq "10" ]] && die $LINENO "Failed to set rabbitmq password" [[ $i -eq "20" ]] && die $LINENO "Failed to set rabbitmq password"
if [[ $(( i % 2 )) == "0" ]] ; then
restart_service rabbitmq-server restart_service rabbitmq-server
fi
rabbit_setuser "$RABBIT_USERID" "$RABBIT_PASSWORD" || rc=$? rabbit_setuser "$RABBIT_USERID" "$RABBIT_PASSWORD" || rc=$?
if [ $rc -ne 0 ]; then if [ $rc -ne 0 ]; then