From 97ce17afc3597b1930fce999483a854a2c6bb181 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Wed, 9 May 2018 13:31:39 -0400 Subject: [PATCH] qa/workunits/rbd: rbd-mirror admin socket commands should retry Signed-off-by: Jason Dillaman (cherry picked from commit a6a8c8a2abfe19b10f9315946eb48f0c1cf630f4) --- qa/workunits/rbd/rbd_mirror_helpers.sh | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/qa/workunits/rbd/rbd_mirror_helpers.sh b/qa/workunits/rbd/rbd_mirror_helpers.sh index 351cdbbaf0c1c..5901dc0b91611 100755 --- a/qa/workunits/rbd/rbd_mirror_helpers.sh +++ b/qa/workunits/rbd/rbd_mirror_helpers.sh @@ -397,14 +397,19 @@ admin_daemons() local cluster_instance=$1 ; shift local cluster="${cluster_instance%:*}" local instance="${cluster_instance##*:}" + local loop_instance - if [ "${instance}" != "${cluster_instance}" ]; then - admin_daemon "${cluster}:${instance}" $@ - else - for instance in `seq 0 ${LAST_MIRROR_INSTANCE}`; do + for s in 0 1 2 4 8 8 8 8 8 8 8 8 16 16; do + sleep ${s} + if [ "${instance}" != "${cluster_instance}" ]; then admin_daemon "${cluster}:${instance}" $@ && return 0 - done - fi + else + for loop_instance in `seq 0 ${LAST_MIRROR_INSTANCE}`; do + admin_daemon "${cluster}:${loop_instance}" $@ && return 0 + done + fi + done + return 1 } all_admin_daemons() @@ -512,11 +517,7 @@ flush() cmd="${cmd} ${pool}/${image}" fi - for s in 1 2 4 8 8 8 8 8 8 8 8 16 16; do - sleep ${s} - admin_daemons "${cluster}" ${cmd} && return 0 - done - return 1 + admin_daemons "${cluster}" ${cmd} } test_image_replay_state() -- 2.39.5