Whamcloud - gitweb
LU-12802 tests: speedup cleanup of racer 89/36289/3
authorLi Xi <lixi@ddn.com>
Wed, 10 Feb 2016 14:37:00 +0000 (22:37 +0800)
committerOleg Drokin <green@whamcloud.com>
Fri, 4 Oct 2019 17:15:34 +0000 (17:15 +0000)
After racer test survives for a given time, it starts to cleanup.
And the parent racer.sh script waits the child racer/racer.sh
to exit. However sometimes, somehow, this stucks for a long time.
Sending a signal to remaining dd(or other) processes will wake up
the wait in parent racer.sh script immediately.

Lustre-change: https://review.whamcloud.com/35101

Test-Parameter: trivial testlist=racer
DDN-Bug-ID: DDN-256
Signed-off-by: Li Xi <lixi@ddn.com>
Reviewed-by: Gu Zheng <gzheng@ddn.com>
Reviewed-by: Wang Shilong <wshilong@ddn.com>
Change-Id: I2ff2784b76faa0532c39af29b1586a48f2b90a21
Reviewed-on: https://review.whamcloud.com/36289
Reviewed-by: Shilong Wang <wshilong@ddn.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/racer/racer.sh

index 9fb4105..036b569 100755 (executable)
@@ -45,6 +45,14 @@ racer_cleanup()
                        killall -0 $P.sh
                        [[ $? -eq 0 ]] && (( rc+=1 ))
                done
                        killall -0 $P.sh
                        [[ $? -eq 0 ]] && (( rc+=1 ))
                done
+
+               # Kill dd processes to speedup cleanup
+               local pids=$(ps uax | grep "$DIR" | grep dd | grep -v grep |
+                               awk '{print $2}')
+               for pid in $pids; do
+                       kill $pid
+               done
+
                if [[ $rc -eq 0 ]]; then
                        echo there should be NO racer processes:
                        ps uww -C "${RACER_PROGS// /.sh,}.sh"
                if [[ $rc -eq 0 ]]; then
                        echo there should be NO racer processes:
                        ps uww -C "${RACER_PROGS// /.sh,}.sh"