From 1a6967eff6663c70e15f14e853f531316ad9eab5 Mon Sep 17 00:00:00 2001 From: Qian Yingjin Date: Mon, 2 Dec 2024 14:10:04 +0800 Subject: [PATCH] LU-18523 tests: wait statahead thread quit during cleanup The list pattern statahead can optimize the stat() workload as follows: - opendir() will authorize the statahead - readdir() to get the name and inode number for the dentries - do stat() on the dentries one by one - closedir() will deauthorize the statahead After closedir() is called, the statahead thread will quit. However, this is not same for fname pattern statahead which workload is calling stat() on the files in Alphabetic sorting order of the file name and does not include by opendir/closedir() call pair. For a fname pattern statahead, the statahead thread will wait for a certain time period (30s by default) and it is not quit until the user is no longer using the directory (traverse and stat) for this long time. Thus after fname statahead pattern is enabled by default, we must wait for stat-ahead thread quit during cleanup. Otherwise, it will faile sanity/test_65j as follow: "cln..There are ll_sa thread not exit!" Test-Parameters: trivial Signed-off-by: Qian Yingjin Change-Id: I510073c38167fd07fc6343dc14a509754bd1eace Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/57337 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Alex Zhuravlev Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- lustre/tests/sanity.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 8578547..e14037c 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -92,6 +92,8 @@ proc_regexp="/{proc,sys}/{fs,sys,kernel/debug}/{lustre,lnet}/" cleanup() { echo -n "cln.." + wait_update_facet client "pgrep ll_sa" "" 35 || + error "ll_sa thread is still running" pgrep ll_sa > /dev/null && { echo "There are ll_sa thread not exit!"; exit 20; } cleanupall ${FORCE} $* || { echo "FAILed to clean up"; exit 20; } } -- 1.8.3.1