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

do not return err when PodSandbox not exist #108325

Merged
merged 1 commit into from
Mar 1, 2022

Conversation

pacoxu
Copy link
Member

@pacoxu pacoxu commented Feb 24, 2022

What type of PR is this?
/kind bug

What this PR does / why we need it:

with --cpu-manager-policy=static, kubelet will panic when pause container lose during kubelet restarting

Which issue(s) this PR fixes:

Fixes #98218
same as #98225 (rebased)

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

kubelet: fix panic when pause container loses during kubelet restarting

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

Co-authored-by: pacoxu <paco.xu@daocloud.io>
@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Feb 24, 2022
@k8s-ci-robot k8s-ci-robot added area/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Feb 24, 2022
@pacoxu
Copy link
Member Author

pacoxu commented Feb 24, 2022

/cc @cynepco3hahue
/assign @sjenning @dims

rebased #98225 for inactivity

@@ -746,12 +740,13 @@ func buildContainerMapFromRuntime(runtimeService internalapi.RuntimeService) (co
containerList, _ := runtimeService.ListContainers(nil)
for _, c := range containerList {
if _, exists := podSandboxMap[c.PodSandboxId]; !exists {
return nil, fmt.Errorf("no PodsandBox found with Id '%s' for container with ID '%s' and Name '%s'", c.PodSandboxId, c.Id, c.Metadata.Name)
klog.InfoS("no PodSandBox found for the container", "podSandboxId", c.PodSandboxId, "containerName", c.Metadata.Name, "containerId", c.Id)
Copy link
Member

Choose a reason for hiding this comment

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

We have also encountered this problem, seems to make sense.

@dims dims removed their assignment Feb 24, 2022
@cynepco3hahue
Copy link

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 27, 2022
@pacoxu
Copy link
Member Author

pacoxu commented Feb 28, 2022

/assign @mrunalp
for approval

@pacoxu
Copy link
Member Author

pacoxu commented Feb 28, 2022

/priority important-longterm
/triage accepted

@k8s-ci-robot k8s-ci-robot added priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. triage/accepted Indicates an issue or PR is ready to be actively worked on. labels Feb 28, 2022
@k8s-ci-robot k8s-ci-robot removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Feb 28, 2022
@pacoxu pacoxu added this to Needs Approver in SIG Node PR Triage Feb 28, 2022
@mrunalp mrunalp moved this from Needs Approver to Done in SIG Node PR Triage Mar 1, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mrunalp, pacoxu

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 1, 2022
@k8s-ci-robot k8s-ci-robot merged commit bef9d80 into kubernetes:master Mar 1, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.24 milestone Mar 1, 2022
@pacoxu pacoxu deleted the donotReturnErrWhenPauseLose branch May 10, 2022 06:28
@rptaylor
Copy link

AFAICT this was merged into the 1.24 release branch:
https://github.com/kubernetes/kubernetes/blob/release-1.24/pkg/kubelet/cm/container_manager_linux.go

However "108325" is not in the v1.24 release notes:
https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.24.md

So it's hard to tell what k8s version actually has this fix.

@pytimer
Copy link
Contributor

pytimer commented Oct 25, 2022

@pacoxu Can we consider merge this pr to 1.23 release branch?

@pacoxu
Copy link
Member Author

pacoxu commented Oct 26, 2022

@rptaylor Probably, we can add a release note for it.

kubelet: fix panic when pause container loses during kubelet restarting

EDITED: We met the same problem with no setting --cpu-manager-policy=static. So I edited the release note here.

k8s-ci-robot added a commit that referenced this pull request Nov 1, 2022
…25-upstream-release-1.23

Automated cherry pick of #108325: do not return err when PodSandbox not exist
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Nov 4, 2022
@gaurav90sharma
Copy link

gaurav90sharma commented Feb 13, 2023

We are facing this issue in "1.21.12" , is there a plan to backport this fix to 1.21 or 1.22 ?

@dims
Copy link
Member

dims commented Feb 13, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/kubelet cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/node Categorizes an issue or PR as relevant to SIG Node. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

kubelet will panic when pause container lose during kubelet restarting