Skip to content

[4.7] Cgroup v1 removal nits/fixes#6

Merged
mrunalp merged 4 commits into
openshift:release-4.7from
kolyshkin:openshift-runc-remove-paths
Oct 21, 2020
Merged

[4.7] Cgroup v1 removal nits/fixes#6
mrunalp merged 4 commits into
openshift:release-4.7from
kolyshkin:openshift-runc-remove-paths

Conversation

@kolyshkin
Copy link
Copy Markdown

This is a backport of opencontainers#2506 to a runc version currently used by openshift/kubernetes master. For more info, see the above PR and/or individual commits.

For one thing, this adds logging to unsuccessful cgroup removal attempts.

RemovePaths() deletes elements from the paths map for paths that has
been successfully removed.

Although, it does not empty the map itself (which is needed that AFAIK
Go garbage collector does not shrink the map), but all its callers do.

Move this operation from callers to RemovePaths.

No functional change, except the old map should be garbage collected now.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 254d23b)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This is to be used by RemovePaths.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 3f14242)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Using os.RemoveAll has the following two issues:

 1. it tries to remove all files, which does not make sense for cgroups;
 2. it tries rm(2) which fails to directories, and then rmdir(2).

Let's reuse our RemovePath instead, and add warnings and errors logging.

PS I am somewhat hesitant to remove the weird checking my means of stat,
as it might break something. Unfortunately, neither commit 6feb7bd
nor the PR it contains [1] do not explain what kind of weird errors were
seen from os.RemoveAll. Most probably our code won't return any bogus
errors, but let's keep the old code to be on the safe side.

[1] docker-archive/libcontainer#308

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 19be8e5)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This is similar to what we did before for v2.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 335f080)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@mrunalp
Copy link
Copy Markdown
Member

mrunalp commented Oct 21, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 21, 2020
@mrunalp mrunalp added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 21, 2020
@mrunalp mrunalp merged commit 5a8da02 into openshift:release-4.7 Oct 21, 2020
@kolyshkin kolyshkin changed the title Cgroup v1 removal nits/fixes [4.7] Cgroup v1 removal nits/fixes May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants