Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Invalid iproute2 command `ip netns id` causes an error message and incorrect NSTAT_HISTORY file path.
--
--- Patch [1]: [PATCH mptcp-next] selftests: mptcp: print stats before socket closure ---
commit 0e02bc2b403cc7ef4929da44802ea29557081b60
Author: Matthieu Baerts (NGI0) <[email protected]>
selftests: mptcp: print stats before socket closure
This commit adds a mechanism to dump socket statistics via ss and nstat
just before socket closure when a poll timeout occurs. This helps debug
timeout issues in the mptcp_connect test.
> diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.c b/tools/testing/selftests/net/mptcp/mptcp_connect.c
> --- a/tools/testing/selftests/net/mptcp/mptcp_connect.c
> +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c
[ ... ]
> @@ -210,6 +210,19 @@ static void xgetaddrinfo(const char *node, const char *service,
> }
> }
>
> +static void print_err_stats(void)
> +{
> + char cmd[128];
> +
> + snprintf(cmd, sizeof(cmd), "ss -Menitam -o '%cport = :%s' >&2",
> + listen_mode ? 's' : 'd', cfg_port);
> +
> + fprintf(stderr, "socket stats before socket closure:\n");
> + (void)!system(cmd);
> + (void)!system("NSTAT_HISTORY='/tmp/$(ip netns id).nstat' nstat -s | "
[Severity: Medium]
Will this ip netns id command fail and cause an iproute2 error during the
test?
It appears ip netns id is an invalid command, and should likely be
ip netns identify.
If it fails, ip netns id will log an error message instead of outputting
the namespace name, which causes the NSTAT_HISTORY environment variable to
fall back to /tmp/.nstat.
Because this fallback file path isn't isolated per namespace, concurrent
test runs might share it, potentially resulting in garbled network
statistics in the debug logs when a timeout occurs.
> + "grep Tcp >&2");
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.