Merged
Conversation
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>
This is to be used by RemovePaths. 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>
Contributor
Author
Member
|
New integration test fails on centos: |
This is similar to what we did before for v2. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Contributor
Author
|
Amended the test case to require cgroupns (testing without it is kinda cumbersome) |
AkihiroSuda
reviewed
Jul 8, 2020
AkihiroSuda
approved these changes
Jul 9, 2020
Member
|
@mrunalp PTAL |
Member
mrunalp
approved these changes
Aug 18, 2020
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This set is a followup to #2503. It does the following:
RemovePathsso its callers don't have to;cgroups.RemovePath(code move fromfs2.removeCgroupPath);cgroups.RemovePaths()by reusingRemovePathinstead ofos.RemoveAll;Please see individual commits for details.