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

Added missing error check that could cause kubelet to crash #60962

Merged
merged 2 commits into from
Mar 12, 2018

Conversation

technicianted
Copy link
Contributor

@technicianted technicianted commented Mar 9, 2018

What this PR does / why we need it:
Adds missing error check. An error can happen due to a race condition when watched files change, or become inaccessible. This can happen if a file was added to the driver directory then quickly removed, in which case the callback will be called with non-nil err and nil info, which is not checked, causing kubelet to crash.

Which issue(s) this PR fixes:
Fixes #60861

Special notes for your reviewer:

Release note:

Fixed missing error checking that could cause kubelet to crash in a race condition.

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 9, 2018
@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


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. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 9, 2018
@k8s-ci-robot k8s-ci-robot requested review from rootfs and sjenning March 9, 2018 05:45
@dims
Copy link
Member

dims commented Mar 9, 2018

/ok-to-test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 9, 2018
@dims
Copy link
Member

dims commented Mar 9, 2018

/sig storage

@k8s-ci-robot k8s-ci-robot added the sig/storage Categorizes an issue or PR as relevant to SIG Storage. label Mar 9, 2018
@dims
Copy link
Member

dims commented Mar 9, 2018

/milestone v1.10

(per @saad-ali 's comment in issue)

@dims
Copy link
Member

dims commented Mar 9, 2018

@technicianted hmm, you have signed the CLA already?

@BenTheElder
Copy link
Member

Hi, GitHub doesn't seem to associate the commit with your account, have you verified the email address used in the commit with GitHub?

@technicianted
Copy link
Contributor Author

@BenTheElder seems like it. Not sure how to fix the commit with the correct email.

@BenTheElder
Copy link
Member

FWIW GitHub has an article here:
https://help.github.com/articles/why-are-my-commits-linked-to-the-wrong-user/
I checked out your PR and the commit seems to have an intel.com email which I'd guess is correct, but your email isn't public so I can't be sure.

@dims
Copy link
Member

dims commented Mar 10, 2018

@technicianted it's easy to switch the email address for example see https://gist.github.com/trey/9588090

if err := prober.watcher.AddWatch(path); err != nil {
glog.Errorf("Error recursively adding watch: %v", err)
if err == nil {
if info.IsDir() {
Copy link
Contributor

Choose a reason for hiding this comment

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

What about err == nil && info.IsDir()? Reduces nesting

@technicianted
Copy link
Contributor Author

@dims I signed the CLA. I made sure my commits have the correct GitHub verified email.

@dims
Copy link
Member

dims commented Mar 10, 2018

/test all

@dims
Copy link
Member

dims commented Mar 10, 2018

@technicianted please reach out to the helpdesk - #27796 (comment)

here's what i see in the PR:

commit 0fb8072b1956cec112f9b961e324a21d69131d39 (HEAD)
Author: technicianted <osama.sorour@eformations.net>
Date:   Fri Mar 9 21:03:22 2018 -0800

    reduce nesting

commit 659d9df117531069026a2c31310702d6dee5d9f0
Author: technicianted <osama.sorour@eformations.net>
Date:   Thu Mar 8 21:39:22 2018 -0800

    added missing error check

@technicianted
Copy link
Contributor Author

/retest

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Mar 12, 2018
@k8s-ci-robot k8s-ci-robot added this to the v1.10 milestone Mar 12, 2018
@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. kind/bug Categorizes issue or PR as related to a bug. labels Mar 12, 2018
@saad-ali
Copy link
Member

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Mar 12, 2018
@k8s-github-robot
Copy link

[MILESTONENOTIFIER] Milestone Pull Request: Up-to-date for process

@saad-ali @technicianted @verult

Pull Request Labels
  • sig/storage: Pull Request will be escalated to these SIGs if needed.
  • priority/important-soon: Escalate to the pull request owners and SIG owner; move out of milestone after several unsuccessful escalation attempts.
  • kind/bug: Fixes a bug discovered during the current release.
Help

@saad-ali
Copy link
Member

Once this is merged, please make sure to cherry pick it back to relevant prior release branches (1.9, etc.)

@k8s-github-robot
Copy link

/test all [submit-queue is verifying that this PR is safe to merge]

@verult
Copy link
Contributor

verult commented Mar 12, 2018

/lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: saad-ali, technicianted, verult

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-github-robot
Copy link

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit 6571be1 into kubernetes:master Mar 12, 2018
@saad-ali
Copy link
Member

@technicianted please remember to cherry pick this PR back to relevant branches (1.9, etc.)

@technicianted
Copy link
Contributor Author

/cherrypick-candidate

@technicianted
Copy link
Contributor Author

@saad-ali please help with cherrypicking

@dims
Copy link
Member

dims commented Mar 13, 2018

@technicianted can you please add a user facing release note in the body of the issue under "Release note:" section above? (currently has NONE there). the branch managers will ask for details.

@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 Mar 13, 2018
@technicianted
Copy link
Contributor Author

@dims added

@dims
Copy link
Member

dims commented Mar 15, 2018

@technicianted thanks. i lined up the cherry picks for you. for next time, cherry pick process is here - https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md

k8s-github-robot pushed a commit that referenced this pull request Mar 28, 2018
…pstream-release-1.8

Automatic merge from submit-queue.

Automated cherry pick of #60962: added missing error check

Cherry pick of #60962 on release-1.8.

#60962: added missing error check
k8s-github-robot pushed a commit that referenced this pull request Mar 29, 2018
…pstream-release-1.9

Automatic merge from submit-queue.

Automated cherry pick of #60962: added missing error check

Cherry pick of #60962 on release-1.9.

#60962: added missing error check
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. 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/storage Categorizes an issue or PR as relevant to SIG Storage. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FlexVolume probe race condition potentially crashes kubelet
7 participants