From 2fc4551317e20b881bb52cf3d5b2e3cfaf5953d0 Mon Sep 17 00:00:00 2001 From: Bruno Faccini Date: Fri, 8 Nov 2013 09:24:21 +0100 Subject: [PATCH] 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 --- lustre/tests/sanity-hsm.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lustre/tests/sanity-hsm.sh b/lustre/tests/sanity-hsm.sh index 7d0a913..00bee8e 100644 --- a/lustre/tests/sanity-hsm.sh +++ b/lustre/tests/sanity-hsm.sh @@ -164,10 +164,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() { -- 1.8.3.1