-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
podman network rm: ... cni plugin bridge failed #12459
Comments
PR #12348 should have fixed the |
I think I can fix it by ignoring the ENOENT error on teardown. If the namespace file does not exists there is no reason to teardown. |
There is (a corner case). The reason I took the time to file this is because I saw it on my own PR the other day (Nov 29) (and yes, I was fully rebased). I didn't realize that the earlier instances were different. Thanks for looking into it. |
Actually no my assumption is wrong, ignoring ENOENT is a bad idea. The problem is that the rootless netns operations are locked. So if two container are stopped at the same time one needs to wait for the other. After the first container is done it will call cleanup to make sure we are not leaking the netns if no containers are running. This is a simple is running check and it will return true because the second container is already stopped and just waiting for the rootless netns lock. So now cleanup will remove the netns and when the second container tries to use the netns it will fail. This is a problem because we need to teardown the network for the second container to free assigned ips for example so we cannot ignore this error. I am not sure if I can find a good solution here. |
rootlessNetNS.Cleanup() has an issue with how it detects if cleanup is needed, reading the container state is not good ebough because containers are first stopped and than cleanup will be called. So at one time two containers could wait for cleanup but the second one will fail because the first one triggered already the cleanup thus making rootless netns unavailable for the second container resulting in an teardown error. Instead of checking the container state we need to check the netns state. Secondly, podman unshare --rootless-netns should not do the cleanup. This causes more issues than it is worth fixing. Users also might want to use this to setup the namespace in a special way. If unshare also cleans this up right away we cannot do this. [NO NEW TESTS NEEDED] Fixes containers#12459 Signed-off-by: Paul Holzinger <[email protected]>
Old flake that I'm only just now categorizing:
This is another one of those that flake in multiple different tests, making it very hard to isolate:
Podman run networking [It] podman run check dnsname plugin
It might be coincidence, but in logs where this error happens, I also tend to see this error:
...and I also tend to see errors in this other test:
Podman run networking [It] podman cni network works across user ns
The text was updated successfully, but these errors were encountered: