-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
runc list: fix race with runc delete + nits #3349
Conversation
Instead of a huge if {} block, use continue. Best reviewed with --ignore-all-space. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Since commit 5516294 we can (and should) use Info() to get access to file stat. Do this. While going over directory entries, a parallel runc delete can remove an entry, and with the current code it results in a fatal error (which was not observed in practice, but looks quite possible). To fix, add a special case to continue on ErrNotExist. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
hi @kolyshkin, @thaJeztah ! this pr was merged to the main two years ago but looks like hasn't made to a release yet (last checked: runc v1.1.12) as we regularly run many integration tests in minikube, we sporadically hit the issue with this race condition and have a workaround to simply retry if that happens, but we are wondering if there are plans to merge this pr at some point (assumption is that this commit is key to avoid erroring on race condition between delete and list)? |
@prezha this PR is merged, but was not backported to 1.1.x. So, it will be included into the upcoming (we are working on 1.2.0-rc1 now). Alas, I did not know that this can be seen in practice. I can open a backport PR to release-1.1 branch, and in case we'll do another 1.1.x release (before 1.2.0), it will be included into that one. |
hey @kolyshkin thanks for the clarification, that makes sense yeah, we did see it occasionally in our integration tests, so it's not impossible in practice :) i appreciate backporting it to v1.1, thanks! |
It is possible that parallel execution of
runc list
withrunc delete
will result inrunc list
fatal failure. Fix this.Bonus: some refactoring.
Please review with --ignore-all-space ("Hide whitespace" checked on GH).