Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.