]> Git Repo - linux.git/commit
kselftest/runner.sh: Propagate SIGTERM to runner child
authorBjörn Töpel <[email protected]>
Wed, 5 Jul 2023 11:53:17 +0000 (13:53 +0200)
committerShuah Khan <[email protected]>
Fri, 8 Sep 2023 16:06:11 +0000 (10:06 -0600)
commit9616cb34b08ec86642b162eae75c5a7ca8debe3c
tree96a3c2774883fa369e66f17a9a8c90792fba6303
parentf4e4ada586995b17f828c6d147d1800eb1471450
kselftest/runner.sh: Propagate SIGTERM to runner child

Timeouts in kselftest are done using the "timeout" command with the
"--foreground" option. Without the "foreground" option, it is not
possible for a user to cancel the runner using SIGINT, because the
signal is not propagated to timeout which is running in a different
process group. The "forground" options places the timeout in the same
process group as its parent, but only sends the SIGTERM (on timeout)
signal to the forked process. Unfortunately, this does not play nice
with all kselftests, e.g. "net:fcnal-test.sh", where the child
processes will linger because timeout does not send SIGTERM to the
group.

Some users have noted these hangs [1].

Fix this by nesting the timeout with an additional timeout without the
foreground option.

Link: https://lore.kernel.org/all/[email protected]/
Fixes: 651e0d881461 ("kselftest/runner: allow to properly deliver signals to tests")
Signed-off-by: Björn Töpel <[email protected]>
Signed-off-by: Shuah Khan <[email protected]>
tools/testing/selftests/kselftest/runner.sh
This page took 0.075395 seconds and 4 git commands to generate.