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

runc list: fix race with runc delete + nits #3349

Merged
merged 2 commits into from
Jan 27, 2022

Conversation

kolyshkin
Copy link
Contributor

@kolyshkin kolyshkin commented Jan 25, 2022

It is possible that parallel execution of runc list with runc delete will result in runc list fatal failure. Fix this.

Bonus: some refactoring.

Please review with --ignore-all-space ("Hide whitespace" checked on GH).

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>
Copy link
Contributor

@mrunalp mrunalp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@prezha
Copy link

prezha commented Mar 26, 2024

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)?

@kolyshkin
Copy link
Contributor Author

@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.

@prezha
Copy link

prezha commented Mar 27, 2024

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!

@kolyshkin kolyshkin added the backport/1.1-done A PR in main branch which has been backported to release-1.1 label Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.1-done A PR in main branch which has been backported to release-1.1 easy-to-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants