Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetCurrentNS doesn't always return the "current" netns #524

Closed
tnqn opened this issue Aug 21, 2020 · 0 comments · Fixed by #523
Closed

GetCurrentNS doesn't always return the "current" netns #524

tnqn opened this issue Aug 21, 2020 · 0 comments · Fixed by #523

Comments

@tnqn
Copy link
Contributor

tnqn commented Aug 21, 2020

We use ns.WithNetNSPath and ip.SetupVethWithName to set up container networking in CNI plugin Antrea. Recently we found a bug antrea-io/antrea#1113 that some Pods' network interfaces were not in the host netns after restarting Worker Nodes. The network interfaces were finally found in other Pods's netns, and we think it's because of a race condition in GetCurrentNS. @antoninbas had a good description about how it happened: antrea-io/antrea#1113 (comment).

The fact that It doesn't happen to other CNIs might be because Antrea has a long running daemon processing all CNI requests and executing the above steps. So if the race condition happens, the "hostNS" might have been another container's netns.

We use this library widely in our project and would appreciate this could be fixed from upstream side. This is a potential fix for it: #523.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant