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

fix(kubelet): protect containerCleanupInfos from concurrent map writes #93773

Merged

Conversation

knight42
Copy link
Member

@knight42 knight42 commented Aug 7, 2020

Signed-off-by: knight42 anonymousknight96@gmail.com

What type of PR is this?

/kind bug

What this PR does / why we need it:

This PR adds a sync.RWMutex to dockerService to protect map dockerService.containerCleanupInfos from concurrent writes.

Which issue(s) this PR fixes:

Fixes #93771

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Fix a concurrent map writes error in kubelet

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


Signed-off-by: knight42 <anonymousknight96@gmail.com>
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Aug 7, 2020
@k8s-ci-robot k8s-ci-robot added area/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Aug 7, 2020
@knight42
Copy link
Member Author

knight42 commented Aug 7, 2020

/assign @Random-Liu

@matthyx
Copy link
Contributor

matthyx commented Aug 7, 2020

/lgtm
Can we add some test coverage, especially some regression detection?

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 7, 2020
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 7, 2020
@knight42
Copy link
Member Author

knight42 commented Aug 7, 2020

@matthyx I have added a regression test, could you please check again?

@matthyx
Copy link
Contributor

matthyx commented Aug 7, 2020

Looks good, now you have to wait for code thaw... and we can contact other approvers from sig-node as well, like @derekwaynecarr

@matthyx
Copy link
Contributor

matthyx commented Aug 7, 2020

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 7, 2020
@dchen1107
Copy link
Member

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dchen1107, knight42

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 Aug 11, 2020
@k8s-ci-robot k8s-ci-robot added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Aug 17, 2020
@knight42
Copy link
Member Author

@andyzhangx All tests passed now. Is it okay to create cherry-pick PRs against release-1.17 and release-1.18 branch?

@andyzhangx
Copy link
Member

@andyzhangx All tests passed now. Is it okay to create cherry-pick PRs against release-1.17 and release-1.18 branch?

yes

@knight42
Copy link
Member Author

@andyzhangx I have filed #94042 and #94043

@SergeyKanzhelev
Copy link
Member

@dchen1107 this is critical enough to create cherry picks for 1.18 and 1.17. Should this be marked as milestone 1.19 to take into the current release?

@zhiweiv
Copy link

zhiweiv commented Aug 26, 2020

@dchen1107
Please take a look when possible, it will be great to merge this before Cherry-picks deadline of 1.17.12(2020-09-11).

@justaugustus justaugustus added this to the v1.20-phase-bug milestone Aug 26, 2020
@zhiweiv
Copy link

zhiweiv commented Aug 31, 2020

@knight42
Since 1.19 is released already, is it necessary to create a cherry pick for 1.19 too?

@matthyx
Copy link
Contributor

matthyx commented Aug 31, 2020

@knight42
Since 1.19 is released already, is it necessary to create a cherry pick for 1.19 too?

yes

@knight42
Copy link
Member Author

@zhiweiv @matthyx I have filed #94352

@knight42
Copy link
Member Author

@justaugustus Hi, would you mind adding this PR to milestone v1.20?

@justaugustus justaugustus modified the milestones: v1.20-phase-bug, v1.20 Aug 31, 2020
@SergeyKanzhelev
Copy link
Member

@knight42 I think the best practice is to squash commits. This will also re-start tests which seems to be an unrelated failure.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

4 similar comments
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@liggitt
Copy link
Member

liggitt commented Sep 1, 2020

@k8s-ci-robot k8s-ci-robot merged commit db10d8c into kubernetes:master Sep 2, 2020
@knight42 knight42 deleted the fix/kubelet-concurrent-map-writes branch September 2, 2020 02:04
k8s-ci-robot added a commit that referenced this pull request Sep 3, 2020
…73-upstream-release-1.17

Automated cherry pick of #93773: fix(kubelet): protect `containerCleanupInfos` from concurrent map writes
k8s-ci-robot added a commit that referenced this pull request Sep 3, 2020
…73-upstream-release-1.18

Automated cherry pick of #93773: fix(kubelet): protect `containerCleanupInfos` from concurrent map writes
k8s-ci-robot added a commit that referenced this pull request Sep 4, 2020
…73-upstream-release-1.19

Automated cherry pick of #93773: fix(kubelet): protect `containerCleanupInfos` from concurrent map writes
@andyzhangx
Copy link
Member

andyzhangx commented Sep 30, 2020

this fix is already in 1.17.12, 1.18.9, 1.19.1, 1.20.0

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-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. 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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kubelet panic with fatal error: concurrent map writes