From 0fa85da9c432ddd61acc179dea61d4b8e7517cd5 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Fri, 14 Apr 2023 01:19:36 +0000 Subject: [PATCH] test: wait_for_examine and delay in reap_unregistered_poller.sh We need to give the thread library some time to reap the unregistered poller - it is a bit of a delayed process. We have to wait for examine to finish on the aio bdev, then the poll group gets destroyed and the pollers unregistered. This marks the pollers as UNREGISTERED, but they aren't actually reaped until next time the thread is polled. Fixes issue #2980. Signed-off-by: Jim Harris Change-Id: I1e32c50ea9b28ea2d5560ddc9b2f68fa81e708d9 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17575 Reviewed-by: Shuhei Matsumoto Tested-by: SPDK CI Jenkins Reviewed-by: Mike Gerdts Reviewed-by: Ben Walker --- test/interrupt/reap_unregistered_poller.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/interrupt/reap_unregistered_poller.sh b/test/interrupt/reap_unregistered_poller.sh index 4046609d4..c35afa513 100755 --- a/test/interrupt/reap_unregistered_poller.sh +++ b/test/interrupt/reap_unregistered_poller.sh @@ -8,6 +8,9 @@ rootdir=$(readlink -f $testdir/../..) source $rootdir/test/common/autotest_common.sh source $testdir/interrupt_common.sh +# This test script makes sure that unregistered pollers are +# reaped correctly when the target is running in interrupt mode. + export PYTHONPATH=$PYTHONPATH:$rootdir/examples/interrupt_tgt # Set reactors with intr_tgt in intr mode @@ -24,6 +27,12 @@ native_pollers+=$(jq -r '.timed_pollers[].name' <<< $app_thread) # pollers like bdev_aio_group_poll poller, and then unregister it. setup_bdev_aio +# Wait for examine to finish, and then sleep a very short amount of +# time to allow the unregistered pollers to get reaped next time +# the spdk_threads are polled +"$rpc_py" bdev_wait_for_examine +sleep 0.1 + # Record names of remaining pollers. app_thread=$(rpc_cmd thread_get_pollers | jq -r '.threads[0]') remaining_pollers=$(jq -r '.active_pollers[].name' <<< $app_thread)