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

Re-introduce serial network setup #99

Merged
merged 1 commit into from
May 17, 2022

Conversation

marc-schwind
Copy link
Contributor

@marc-schwind marc-schwind commented May 17, 2022

Some use cases require serialized network setup to ensure proper network namespace switching on the same thread.

As ns.Set() cannot be relied upon when goroutines switch OS threads callers of CNI.Setup(...) may want to wrap the setup network creation in a closure locking the OS thread, as described here: https://github.com/containernetworking/plugins/tree/main/pkg/ns#do-the-recommended-thing

For more details and background also see https://github.com/containernetworking/plugins/tree/main/pkg/ns#namespace-switching

With the performance improvements introduced with PR76 such use cases break.

This PR re-introduces an additional serialized version SetupSerially(...) of CNI network setup/attach to accommodate the above mentioned use cases, while leaving the main code path untouched to ensure the non-edge cases can benefit from the performance recent enhancement.

Copy link
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

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

LGTM Thanks!

@dims
Copy link
Member

dims commented May 17, 2022

LGTM

@mikebrow mikebrow merged commit 8cb24f1 into containerd:main May 17, 2022
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.

3 participants