From: Bruno Faccini Date: Fri, 8 Nov 2013 08:24:21 +0000 (+0100) Subject: LU-4093 tests: prevent zombie requests when stopping CT X-Git-Tag: 2.5.52~97 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=0ec1dbbea450375af070838ce6487e14c6595c83;ds=inline LU-4093 tests: prevent zombie requests when stopping CT Fix to prevent any current requests to become zombie when stopping copytool and thus not to sometimes to induce failures during next sanity-hsm sub-tests. Signed-off-by: Bruno Faccini Change-Id: I3274e5864469251e6f2040377b84429e4f218f47 Reviewed-on: http://review.whamcloud.com/8157 Tested-by: Jenkins Reviewed-by: John L. Hammond Tested-by: Maloo Reviewed-by: jacques-Charles Lafoucriere Reviewed-by: Aurelien Degremont Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/sanity-hsm.sh b/lustre/tests/sanity-hsm.sh index 04bcd65..8b89a18 100644 --- a/lustre/tests/sanity-hsm.sh +++ b/lustre/tests/sanity-hsm.sh @@ -163,10 +163,34 @@ copytool_setup() { copytool_cleanup() { trap - EXIT local agents=${1:-$(facet_active_host $SINGLEAGT)} + local mdtno + local idx + local oldstate + local mdt_hsmctrl do_nodesv $agents "pkill -INT -x $HSMTOOL_BASE" || return 0 sleep 1 echo "Copytool is stopped on $agents" + + # clean all CDTs orphans requests from previous tests + # that would otherwise need to timeout to clear. + for mdtno in $(seq 1 $MDSCOUNT); do + idx=$(($mdtno - 1)) + mdt_hsmctrl="mdt.$FSNAME-MDT000${idx}.hsm_control" + oldstate=$(do_facet mds${mdtno} "$LCTL get_param -n " \ + "$MDT_HSMCTRL") + # skip already stop[ed,ing] CDTs + echo $oldstate | grep stop || continue + + do_facet mds${mdtno} "$LCTL set_param $mdt_hsmctrl=shutdown" + wait_result mds${mdtno} "$LCTL get_param -n $mdt_hsmctrl" \ + "stopped" 20 || + error "mds${mdtno} cdt state is not stopped" + do_facet mds${mdtno} "$LCTL set_param $mdt_hsmctrl=$oldstate" + wait_result mds${mdtno} "$LCTL get_param -n $mdt_hsmctrl" \ + "$oldstate" 20 || + error "mds${mdtno} cdt state is not $oldstate" + done } copytool_suspend() {