Skip to content

Conversation

@Luap99
Copy link
Member

@Luap99 Luap99 commented Apr 11, 2025

This is flaking in podman for a while[1], likely ever since we enabled parallel tests. The cgroups may be removed while we try to gather stats, that is normal and expected and should not lead to warnings.

If no cgroup is found we still return ErrStatCgroup so a caller can then match this. There was attempt to fix this in podman[2] but we missed that the warning is printed here.

Example output from the test:
$ podman stats -a --no-stream --no-reset
time="2025-04-10T06:24:16-05:00" level=warning msg="Failed to retrieve cgroup stats: open /sys/fs/cgroup/user.slice/user-6259.slice/[email protected]/user.slice/user-libpod_pod_6c6a40019844d59a70070655263388f2e81a04e2764a1cc138b37d8202e1fefe.slice/libpod-655275f1c204008257f81ebe2503557ffadaa210f988b2d15c1cc818160af72a.scope/memory.stat: no such file or directory" time="2025-04-10T06:24:16-05:00" level=warning msg="Failed to retrieve cgroup stats: open /sys/fs/cgroup/user.slice/user-6259.slice/[email protected]/user.slice/user-libpod_pod_6c6a40019844d59a70070655263388f2e81a04e2764a1cc138b37d8202e1fefe.slice/libpod-655275f1c204008257f81ebe2503557ffadaa210f988b2d15c1cc818160af72a.scope/pids.current: no such file or directory"
ID NAME CPU % MEM USAGE / LIMIT MEM % NET IO BLOCK IO PIDS CPU TIME AVG CPU %
812b76331dbb a8bc9aac52b7-service 3.99% 0B / 4.092GB 0.00% 0B / 0B 0B / 0B 1 7.311ms 3.99%
...

[1] https://api.cirrus-ci.com/v1/artifact/task/5931471380152320/html/sys-podman-fedora-41-rootless-host-sqlite.log.html
[2] containers/podman@1f44d0f

Summary by Sourcery

Bug Fixes:

  • Remove warning log when encountering a non-existent cgroup during stats retrieval, as this is an expected scenario during parallel tests

This is flaking in podman for a while[1], likely ever since we enabled
parallel tests. The cgroups may be removed while we try to gather stats,
that is normal and expected and should not lead to warnings.

If no cgroup is found we still return ErrStatCgroup so a caller can then
match this. There was attempt to fix this in podman[2] but we missed that
the warning is printed here.

Example output from the test:
$ podman stats -a --no-stream --no-reset
time="2025-04-10T06:24:16-05:00" level=warning msg="Failed to retrieve cgroup stats: open /sys/fs/cgroup/user.slice/user-6259.slice/[email protected]/user.slice/user-libpod_pod_6c6a40019844d59a70070655263388f2e81a04e2764a1cc138b37d8202e1fefe.slice/libpod-655275f1c204008257f81ebe2503557ffadaa210f988b2d15c1cc818160af72a.scope/memory.stat: no such file or directory"
time="2025-04-10T06:24:16-05:00" level=warning msg="Failed to retrieve cgroup stats: open /sys/fs/cgroup/user.slice/user-6259.slice/[email protected]/user.slice/user-libpod_pod_6c6a40019844d59a70070655263388f2e81a04e2764a1cc138b37d8202e1fefe.slice/libpod-655275f1c204008257f81ebe2503557ffadaa210f988b2d15c1cc818160af72a.scope/pids.current: no such file or directory"
ID            NAME                  CPU %       MEM USAGE / LIMIT  MEM %       NET IO       BLOCK IO    PIDS        CPU TIME    AVG CPU %
812b76331dbb  a8bc9aac52b7-service  3.99%       0B / 4.092GB       0.00%       0B / 0B      0B / 0B     1           7.311ms     3.99%
...

[1] https://api.cirrus-ci.com/v1/artifact/task/5931471380152320/html/sys-podman-fedora-41-rootless-host-sqlite.log.html
[2] containers/podman@1f44d0f

Signed-off-by: Paul Holzinger <[email protected]>
@sourcery-ai
Copy link

sourcery-ai bot commented Apr 11, 2025

Reviewer's Guide by Sourcery

The pull request removes the logging of a warning message when the cgroup stats retrieval fails due to a non-existent file (ENOENT error). This change is made to prevent unnecessary warnings in scenarios where cgroups are expected to be removed during parallel tests, which is a normal and expected behavior.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Remove logging of ENOENT error in cgroup stats retrieval.
  • Deleted the log statement that logs a warning when a cgroup stat retrieval fails due to a non-existent file.
pkg/cgroups/cgroups_linux.go

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@Luap99
Copy link
Member Author

Luap99 commented Apr 11, 2025

cc @giuseppe

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Luap99 - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 11, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: giuseppe, Luap99, sourcery-ai[bot], vrothberg

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [Luap99,giuseppe,vrothberg]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit dd8ab77 into containers:main Apr 11, 2025
14 of 15 checks passed
@Luap99 Luap99 deleted the cgroups-flake branch April 11, 2025 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants