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 UnmountDevice failure on Windows #68608

Merged
merged 1 commit into from
Sep 26, 2018

Conversation

andyzhangx
Copy link
Member

@andyzhangx andyzhangx commented Sep 13, 2018

What this PR does / why we need it:
fix UnmountDevice failure on Windows, root cause is GetMountRefs on windows is not correctly implemented.
Error code is like following:

E0912 04:11:58.069277    4308 nestedpendingoperations.go:267] Operation for "\"kubernetes.io/azure-disk//subscriptions/xxx/resourceGroups/andy-k8swin1120beta1/providers/Microsoft.Compute/disks/andy-k8swin1120beta1-dynamic-pvc-ec35a4b1-b637-11e8-bb79-000d3af7dab4\"" failed. No retries permitted until 2018-09-12 04:14:00.0692771 +0000 GMT m=+572.648837101 (durationBeforeRetry 2m2s). Error: "GetDeviceMountRefs check failed for volume \"pvc-ec35a4b1-b637-11e8-bb79-000d3af7dab4\" (UniqueName: \"kubernetes.io/azure-disk//subscriptions/xxx/resourceGroups/andy-k8swin1120beta1/providers/Microsoft.Compute/disks/andy-k8swin1120beta1-dynamic-pvc-ec35a4b1-b637-11e8-bb79-000d3af7dab4\") on node \"18986k8s9001\" : The device mount path \"\\\\var\\\\lib\\\\kubelet\\\\plugins\\\\kubernetes.io\\\\azure-disk\\\\mounts\\\\m1433781257\" is still mounted by other references [c:\\var\\lib\\kubelet\\plugins\\kubernetes.io\\azure-disk\\mounts\\m1433781257 F:\\]"

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #68512

Special notes for your reviewer:
On Windows, there is no place to query all mount points like /proc/mounts on Linux, so I actually did an empty implementation for GetMountRefs on Windows, which could skip the below error check:

if err != nil || mount.HasMountRefs(deviceMountPath, refs) {
if err == nil {
err = fmt.Errorf("The device mount path %q is still mounted by other references %v", deviceMountPath, refs)

Release note:

fix UnmountDevice failure on Windows

/kind bug
/sig windows
@PatrickLang

@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. sig/windows Categorizes an issue or PR as relevant to SIG Windows. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 13, 2018
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 13, 2018
@andyzhangx
Copy link
Member Author

/test pull-kubernetes-cross

@andyzhangx
Copy link
Member Author

/assign @jsafrane @msau42

@msau42
Copy link
Member

msau42 commented Sep 13, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 13, 2018
@andyzhangx
Copy link
Member Author

@jsafrane PTAL

@andyzhangx
Copy link
Member Author

/test pull-kubernetes-kubemark-e2e-gce-big

@jsafrane
Copy link
Member

/approve

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 18, 2018
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 19, 2018
add comments

fix test failure
@andyzhangx
Copy link
Member Author

/test pull-kubernetes-cross

@andyzhangx
Copy link
Member Author

rebased, and I changed the test code a little @jsafrane PTAL

@jsafrane
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 19, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andyzhangx, jsafrane, msau42

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 added a commit that referenced this pull request Sep 27, 2018
…8608-upstream-release-1.9

Automated cherry pick of #68608: fix UnmountDevice failure on Windows
k8s-ci-robot added a commit that referenced this pull request Sep 28, 2018
…8608-upstream-release-1.12

Automated cherry pick of #68608: fix UnmountDevice failure on Windows
k8s-ci-robot added a commit that referenced this pull request Oct 2, 2018
…8608-upstream-release-1.10

Automated cherry pick of #68608: fix UnmountDevice failure on Windows
k8s-ci-robot added a commit that referenced this pull request Oct 4, 2018
…8608-upstream-release-1.11

Automated cherry pick of #68608: fix UnmountDevice failure on Windows
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. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/windows Categorizes an issue or PR as relevant to SIG Windows. 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.

PersistentVolumeClaims never finish unmounting on Windows nodes
4 participants