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

runtime/v2/runc: fix the defer cleanup of the NewContainer #5206

Merged
merged 1 commit into from
Mar 17, 2021

Conversation

Iceber
Copy link
Member

@Iceber Iceber commented Mar 16, 2021

The cleanup operation does not take effect in many cases

e.g.

if err := m.Mount(rootfs); err != nil {
return nil, errors.Wrapf(err, "failed to mount rootfs component %v", m)
}
}

if err := p.Create(ctx, config); err != nil {
return nil, errdefs.ToGRPC(err)
}

if cgroups.Mode() == cgroups.Unified {
g, err := cgroupsv2.PidGroupPath(pid)
if err != nil {
logrus.WithError(err).Errorf("loading cgroup2 for %d", pid)
return container, nil
}
cg, err = cgroupsv2.LoadManager("/sys/fs/cgroup", g)
if err != nil {
logrus.WithError(err).Errorf("loading cgroup2 for %d", pid)
}

@k8s-ci-robot
Copy link

Hi @Iceber. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Mar 16, 2021

Build succeeded.

Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
@theopenlab-ci
Copy link

theopenlab-ci bot commented Mar 16, 2021

Build succeeded.

Copy link
Member

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

@Zyqsempai Zyqsempai left a comment

Choose a reason for hiding this comment

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

LG

Copy link
Member

@fuweid fuweid left a comment

Choose a reason for hiding this comment

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

LGTM

@fuweid fuweid merged commit 1a0973d into containerd:master Mar 17, 2021
@Iceber
Copy link
Member Author

Iceber commented Mar 17, 2021

@fuweid Is it necessary to fix release/1.4? This looks useful for the previous version.

@fuweid
Copy link
Member

fuweid commented Mar 17, 2021

@fuweid Is it necessary to fix release/1.4? This looks useful for the previous version.

yeah. please

@fuweid fuweid added the cherry-pick/1.4.x Change to be cherry picked to release/1.4 branch label Mar 17, 2021
@thaJeztah thaJeztah added cherry-picked/1.4.x PR commits are cherry picked into the release/1.4 branch and removed cherry-pick/1.4.x Change to be cherry picked to release/1.4 branch labels Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-picked/1.4.x PR commits are cherry picked into the release/1.4 branch needs-ok-to-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants