From: netdev-bot+sashiko@kernel.org
To: rjethwani@purestorage.com
Cc: netdev@vger.kernel.org, stable@vger.kernel.org,
john.fastabend@gmail.com, kuba@kernel.org, sd@queasysnail.net,
davem@davemloft.net, edumazet@kernel.org, pabeni@redhat.com,
willemb@google.com, horms@kernel.org, alice.kernel@fastmail.im,
tariqt@nvidia.com
Subject: Re: [PATCH net v3 6/9] selftests: net: py: add a timeout argument to bkg()
Date: Sun, 06 Dec 2026 00:23:09 +0000 [thread overview]
Message-ID: <179651658944.3148.162921538728943469@kernel.org> (raw)
In-Reply-To: <20261204235642.36653-7-rjethwani@purestorage.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] bkg.__exit__() handles timeout=None differently on its two
cancellation paths.
--
selftests: net: py: add a timeout argument to bkg()
This patch adds a timeout argument to bkg() so callers can override the
20-second context-exit timeout. A value of None waits indefinitely on
normal exit, while a readiness-enabled command gets one second to exit on
cancellation.
> diff --git a/tools/testing/selftests/net/lib/py/utils.py b/tools/testing/selftests/net/lib/py/utils.py
> index 9edfc4f88621c..1db7a21db6423 100644
> --- a/tools/testing/selftests/net/lib/py/utils.py
> +++ b/tools/testing/selftests/net/lib/py/utils.py
> @@ -274,7 +274,11 @@ class cmd:
> if self.proc.poll() is None:
> if terminate:
> self._kill_group(signal.SIGTERM)
> - self._drain_until_exit((out, err), timeout=timeout)
> + # None waits forever elsewhere; cleanup must end. Not
> + # "timeout or 1", which would change an explicit 0.
> + self._drain_until_exit((out, err),
> + timeout=1 if timeout is None
> + else timeout)
> self._collect_reaped(out, err)
[ ... ]
> @@ -410,15 +415,18 @@ class bkg(cmd):
> terminate = terminate or (self._exit_wait and ex_type is not None)
> if ex_type is None:
> return self.process(terminate=terminate, fail=self.check_fail,
> - expect_fail=self.expect_fail)
> + expect_fail=self.expect_fail,
> + timeout=self.timeout)
> # Cancelled, e.g. by Ctrl-C: stop the command and what it started,
> # without replacing the exception in flight.
> if self._own_pgrp:
> - self._cleanup_quietly(self._reap_cancelled, terminate, 20)
> + self._cleanup_quietly(self._reap_cancelled, terminate,
> + self.timeout)
> else:
> self._cleanup_quietly(self.process, terminate=terminate,
> fail=self.check_fail,
> - expect_fail=self.expect_fail)
> + expect_fail=self.expect_fail,
> + timeout=self.timeout)
[Severity: Medium]
Can cancellation cleanup hang here when bkg() is created with
timeout=None?
The new comment in cmd._reap_cancelled() says "cleanup must end", and that
path maps None to a 1 second grace period. That only covers _own_pgrp
commands, though.
This else branch handles every remote (host=) command and every local
command started without ksft_ready/ksft_wait. It passes self.timeout to
process() unchanged, so None reaches cmd._process_terminate():
bkg.__exit__()
_cleanup_quietly(self.process, ..., timeout=None)
cmd.process()
cmd._process_terminate()
self.proc.terminate()
stdout, stderr = self.proc.communicate(timeout=timeout)
proc.terminate() only signals the leader. If the command ignores SIGTERM,
or if it is a shell whose descendants keep stdout/stderr open, does
communicate(timeout=None) ever return?
_cleanup_quietly() only catches Exception, and nothing is raised in this
case. A test assertion failure inside the with-block would then hang the
runner while the exception unwinds, and no second Ctrl-C is coming to
break out of it.
Before this patch both cancellation paths were bounded at 20 seconds. The
else branch got that from process()'s default timeout=20.
Would it make sense to apply the same "1 if timeout is None else timeout"
mapping in this branch, or to describe the difference in the commit
message? The commit message currently only says:
None waits indefinitely on normal exit, but gives a readiness-enabled
command one second to exit on cancellation.
> return None
>
>
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261204235642.36653-1-rjethwani%40purestorage.com
next prev parent reply other threads:[~2026-12-06 0:23 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 23:53 [PATCH net v3 0/9] tls: device: don't put offload plaintext on the wire Rishikesh Jethwani
2026-12-04 23:53 ` [PATCH net v3 1/9] net: don't fragment skbs that still need device crypto Rishikesh Jethwani
2026-12-04 23:53 ` [PATCH net v3 2/9] tls: device: keep tls_sw_fallback() from encrypting its own output Rishikesh Jethwani
2026-12-04 23:53 ` [PATCH net v3 3/9] tls: device: don't let the NIC encrypt fallback output again Rishikesh Jethwani
2026-12-06 0:23 ` netdev-bot+sashiko
2026-12-04 23:53 ` [PATCH net v3 4/9] tls: device: remove the dead start marker bypass in TX fallback Rishikesh Jethwani
2026-12-06 0:23 ` netdev-bot+sashiko
2026-12-04 23:53 ` [PATCH net v3 5/9] selftests: net: py: reap commands that fail to report ready Rishikesh Jethwani
2026-12-06 0:23 ` netdev-bot+sashiko
2026-12-04 23:53 ` [PATCH net v3 6/9] selftests: net: py: add a timeout argument to bkg() Rishikesh Jethwani
2026-12-06 0:23 ` netdev-bot+sashiko [this message]
2026-12-04 23:53 ` [PATCH net v3 7/9] selftests: net: add TLS offload over bond tests Rishikesh Jethwani
2026-12-06 0:23 ` netdev-bot+sashiko
2026-12-04 23:53 ` [PATCH net v3 8/9] selftests: net: test TLS fallback after rerouting to an upper device Rishikesh Jethwani
2026-12-06 0:23 ` netdev-bot+sashiko
2026-12-04 23:53 ` [PATCH net v3 9/9] selftests: net: verify that IP refuses to fragment TLS offload data Rishikesh Jethwani
2026-12-06 0:23 ` netdev-bot+sashiko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179651658944.3148.162921538728943469@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=alice.kernel@fastmail.im \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rjethwani@purestorage.com \
--cc=sd@queasysnail.net \
--cc=stable@vger.kernel.org \
--cc=tariqt@nvidia.com \
--cc=willemb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox