-
Notifications
You must be signed in to change notification settings - Fork 39.9k
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 iSCSI panic in DetachDisk #69140
Conversation
Fill iscsiDetacher.plugin so iscsiDetacher.plugin.targetLocks.LockKey(iqn) does not panic.
return err | ||
} | ||
if !notMnt { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can it change between check and umount attempt? maybe unmount unconditionally but recognise a "not mounted" error ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kubelet itself makes sure that only one UnmountDevice
runs for a given volume. So it can't change unless something else (admin) unmounts things in parallel.
And even if the volume is unmounted by admin after the check, the volume plugin calls umount
, which fails, and kubelet re-tries UnmountDevice
in a short while, now with correct check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It just feels akin to file exist check before deleting it, just deleting is more correct and no races
This is a good catch. I think it was my fix to prevent login/logout race conditions that created this bug, and I need to figure out why my testing didn't catch this. Sorry! |
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
(Although I'm not well versed in these bits).
return err | ||
} | ||
if !notMnt { | ||
if err := c.mounter.Unmount(mntPath); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to use k8s.io/kubernetes/pkg/volume/util
's UnmountPath
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, fixed.
@bertinatto: changing LGTM is restricted to assignees, and only kubernetes/kubernetes repo collaborators may be assigned issues. In response to this:
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. |
/lgtm |
@bswartz: changing LGTM is restricted to assignees, and only kubernetes/kubernetes repo collaborators may be assigned issues. In response to this:
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 got second thoughts about using I restored the original behavior and the directory will be removed only when |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bertinatto, bswartz, humblec, jsafrane 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 |
/kind bug |
…40-upstream-release-1.12 Automated cherry pick of #69140: Fixed panic in iSCSI.UnmountDevice
There are two commits there:
iscsiDetacher.plugin
soDetachDisk
does not panic.Fixes #69137
/sig storage
/priority important-soon
cc @humblec @bswartz @redbaron