Merged
Conversation
8e214b4 to
cb800c7
Compare
Commit 3ec19ff introduced a GC goroutine to delete files where netns were mounted. It was primarly added to work around a race in kernel 3.18-4.0.1. Since no distros we support are using such old kernels, there's no need to keep this code around. Signed-off-by: Albin Kerouanton <albinker@gmail.com>
cb800c7 to
f053beb
Compare
thaJeztah
reviewed
Dec 16, 2024
| gpmChan = make(chan chan struct{}) | ||
| netnsBasePath = filepath.Join(defaultPrefix, "netns") | ||
| once sync.Once | ||
| netnsBasePath = filepath.Join(defaultPrefix, "netns") |
Member
There was a problem hiding this comment.
Not related to this PR probably, but I was curious what this once was used for (we should probably rename it to describe what it's for); but looking at that once, the logic seems ... iffy .. it's used to call createBasePath (which is "ok"), but createBasePath depends on basepath(), which returns netnsBasePath, which can be set through an exported function SetBasePath();
- the
basepath()function for sure looks redundant (but that's a nit) SetBasePath()has no synchronisation- It also means that
SetBasePathcan be called aftercreateBasePathran, and it would not run again (ifnetnsBasePathwas modified
moby/libnetwork/osl/namespace_linux.go
Lines 51 to 68 in 577a795
Member
|
I added a link to the original PR in libnetwork (moby/libnetwork#223), which also mentions the fix in the kernel, which went in to kernel 4.1; torvalds/linux@8f502d5 |
vvoland
approved these changes
Dec 16, 2024
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.
- What I did
Commit 3ec19ff introduced a GC goroutine to delete files where netns were mounted. It was primarly added to work around a race in kernel 3.18-4.0.1. Since no distros we support are using such old kernels, there's no need to keep this code around.
- How to verify it
Existing tests.