* [PATCH] ss: Tone down cgroup path resolution
@ 2025-02-10 14:11 Michal Koutný
2025-02-18 13:11 ` Davide Benini
2025-02-20 22:20 ` Stephen Hemminger
0 siblings, 2 replies; 5+ messages in thread
From: Michal Koutný @ 2025-02-10 14:11 UTC (permalink / raw)
To: netdev; +Cc: mkoutny, mkubecek
Sockets and cgroups have different lifetimes (e.g. fd passing between
cgroups) so obtaining a cgroup id to a removed cgroup dir is not an
error. Furthermore, the message is printed for each such a socket.
Improve user experience by silencing these specific errors.
---
lib/fs.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/fs.c b/lib/fs.c
index 622f28b3..6fe1d6db 100644
--- a/lib/fs.c
+++ b/lib/fs.c
@@ -223,7 +223,8 @@ char *get_cgroup2_path(__u64 id, bool full)
fd = open_by_handle_at(mnt_fd, fhp, 0);
if (fd < 0) {
- fprintf(stderr, "Failed to open cgroup2 by ID\n");
+ if (errno != ESTALE)
+ fprintf(stderr, "Failed to open cgroup2 by ID\n");
goto out;
}
--
2.48.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] ss: Tone down cgroup path resolution
2025-02-10 14:11 [PATCH] ss: Tone down cgroup path resolution Michal Koutný
@ 2025-02-18 13:11 ` Davide Benini
2025-02-18 13:40 ` Michal Koutný
2025-02-20 22:20 ` Stephen Hemminger
1 sibling, 1 reply; 5+ messages in thread
From: Davide Benini @ 2025-02-18 13:11 UTC (permalink / raw)
To: Michal Koutný, netdev; +Cc: mkubecek
On 10/02/25 15:11, Michal Koutný wrote:
> Sockets and cgroups have different lifetimes (e.g. fd passing between
> cgroups) so obtaining a cgroup id to a removed cgroup dir is not an
> error. Furthermore, the message is printed for each such a socket.
> Improve user experience by silencing these specific errors.
Note that if ss has been called with -e (to show detailed socket information) or with --cgroup (to show cgroup information), even if the message "Failed to open cgroup2 by ID" will no longer appear, however the cg_id_to_path() will return a string "unreachable:%llx" and the output will still be similar to
tcp LISTEN 0 4096 [::]:2049 [::]:* ino:710321 sk:10da cgroup:unreachable:8ed7 v6only:1 <->
But I agree that removing the specific error message would be enough to prevent customer concern.
Davide Benini
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ss: Tone down cgroup path resolution
2025-02-18 13:11 ` Davide Benini
@ 2025-02-18 13:40 ` Michal Koutný
0 siblings, 0 replies; 5+ messages in thread
From: Michal Koutný @ 2025-02-18 13:40 UTC (permalink / raw)
To: Davide Benini; +Cc: netdev, mkubecek
[-- Attachment #1: Type: text/plain, Size: 492 bytes --]
On Tue, Feb 18, 2025 at 02:11:06PM +0100, Davide Benini <davide.benini@suse.com> wrote:
> however the cg_id_to_path() will return a string "unreachable:%llx"
> and the output will still be similar to
And I think that is good -- it captures the situation with the socket
like its "property" and not a global error.
> But I agree that removing the specific error message would be enough
> to prevent customer concern.
One can do only so much with sockets of rmdir'd cgroups.
Thanks,
Michal
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ss: Tone down cgroup path resolution
2025-02-10 14:11 [PATCH] ss: Tone down cgroup path resolution Michal Koutný
2025-02-18 13:11 ` Davide Benini
@ 2025-02-20 22:20 ` Stephen Hemminger
2025-02-21 9:32 ` Michal Koutný
1 sibling, 1 reply; 5+ messages in thread
From: Stephen Hemminger @ 2025-02-20 22:20 UTC (permalink / raw)
To: Michal Koutný; +Cc: netdev, mkubecek
On Mon, 10 Feb 2025 15:11:03 +0100
Michal Koutný <mkoutny@suse.com> wrote:
> Sockets and cgroups have different lifetimes (e.g. fd passing between
> cgroups) so obtaining a cgroup id to a removed cgroup dir is not an
> error. Furthermore, the message is printed for each such a socket.
> Improve user experience by silencing these specific errors.
> ---
> lib/fs.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Patch looks good, but will not apply since missing Signed-off-by.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ss: Tone down cgroup path resolution
2025-02-20 22:20 ` Stephen Hemminger
@ 2025-02-21 9:32 ` Michal Koutný
0 siblings, 0 replies; 5+ messages in thread
From: Michal Koutný @ 2025-02-21 9:32 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev, mkubecek
[-- Attachment #1: Type: text/plain, Size: 292 bytes --]
On Thu, Feb 20, 2025 at 02:20:43PM -0800, Stephen Hemminger <stephen@networkplumber.org> wrote:
> Patch looks good, but will not apply since missing Signed-off-by.
Thanks.
(Feel free to ignore v2 2/2 patch but believe me I checked README.devel
before sending the original patch ;-))
Michal
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-02-21 9:32 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-10 14:11 [PATCH] ss: Tone down cgroup path resolution Michal Koutný
2025-02-18 13:11 ` Davide Benini
2025-02-18 13:40 ` Michal Koutný
2025-02-20 22:20 ` Stephen Hemminger
2025-02-21 9:32 ` Michal Koutný
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).