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

Enforce global lock in oci hooks #3522

Merged
merged 1 commit into from
Oct 10, 2024
Merged

Conversation

apostasie
Copy link
Contributor

@apostasie apostasie commented Oct 8, 2024

See
#3518
#2908

and probably others.

At this point, nerdctl simply cannot be used in any non trivial scenario involving CNI and concurrency.

Besides local context, this started cropping up as soon as I disabled retries on the CI and cranked up parallelism on tests.

The bottom-line MAY be that CNI plugins cannot be used concurrently at all - whether by design or not - this is unconfirmed though.

A "proper" fix is likely very involved - probably rewriting most / all of CNIEnv, or the cni plugins themselves. As floated in the tickets, it is not even clear if separate binaries + ocihooks is a tenable design at all.

Anyhow, this is the best I can think of right now that does not involve too much work: enforce a global lock in hooks. It is a hammer. It will hurt performance, likely. But then the choice is "does not work" vs. "works slowly".
As stated in the comment, it will probably not even cover all cases - but it is better than nothing and will make things a bit more acceptable.

This has been forked out of #3517 which is currently ground zero.

@apostasie
Copy link
Contributor Author

@AkihiroSuda at your convenience.
(pending green)

@apostasie apostasie marked this pull request as ready for review October 8, 2024 23:19
@apostasie
Copy link
Contributor Author

Failure is the usual TestIPFSComposeUp/stargz

pkg/ocihook/ocihook.go Outdated Show resolved Hide resolved
pkg/ocihook/ocihook.go Outdated Show resolved Hide resolved
@AkihiroSuda AkihiroSuda added this to the v2.0.0 milestone Oct 10, 2024
Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

Thanks

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 this pull request may close these issues.

2 participants