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: Pod terminating stuck because of trying to umount not actual mounted dir #114605
Conversation
Welcome @mochizuki875! |
Hi @mochizuki875. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/sig storage |
/ok-to-test |
Hi @andyzhangx , thank you for fixing the issue #114736. |
/sig node |
@mochizuki875 could you point out which line of code fix the original nfs unmount stuck issue in this PR? thanks. |
@andyzhangx kubernetes/pkg/volume/nfs/nfs.go Line 294 in 0b2e541
And then, calls
Finally, Before your PR(#114736), there was not the check logic of umount result in And I implemented https://github.com/kubernetes/kubernetes/blob/891eb75b8956c94c59dbfab29e78f12863202088/staging/src/k8s.io/mount-utils/mount_linux.go#L361-L369 Also, although it is a small detail, the names of variables that indicate the same meaning were different between |
/priority important-soon |
@@ -620,3 +621,28 @@ func makeFakeCommandAction(stdout string, err error) testexec.FakeCommandAction | |||
return testexec.InitFakeCmd(&c, cmd, args...) | |||
} | |||
} | |||
|
|||
func TestNotMountedBehaviorOfUnmount(t *testing.T) { |
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.
This breaks running unit tests without superuser mode
Running unit tests downstream, this is the only failing unit test:
{Failed === RUN TestNotMountedBehaviorOfUnmount
mount_linux_test.go:719: Expect complete Unmount(), but it dose not: unmount failed: exit status 32
Unmounting arguments: /tmp/kubelet-umount2687109515
Output: umount: /tmp/kubelet-umount2687109515: must be superuser to unmount.
mount_linux_test.go:723: Expect complete tryUnmount(), but it does not: unmount failed: exit status 32
Unmounting arguments: /tmp/kubelet-umount2687109515
Output: umount: /tmp/kubelet-umount2687109515: must be superuser to unmount.
mount_linux_test.go:729: Expect complete forceUnmount(), but it does not: unmount failed: exit status 32
Unmounting arguments: /tmp/kubelet-umount2687109515
Output: umount: /tmp/kubelet-umount2687109515: must be superuser to unmount.
--- FAIL: TestNotMountedBehaviorOfUnmount (0.03s)
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.
Opened a revert: #115732
Revert #114605: its unit test requires root permission
…t-test Revert "Revert #114605: its unit test requires root permission"
Fix: Pod terminating stuck because of trying to umount not actual mounted dir
Are there any plans to backport this to older Kubernetes versions? This seems like a critical fix. |
@ljosyula considering you have filed the PRs for 1.25 and 1.26, can you file one for 1.24 as well? |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Fix the problem Pod terminating stuck because of trying to umount not actual mounted dir.
In addition, I refactored releted methods and functions.
Which issue(s) this PR fixes:
Fixes #114546
Special notes for your reviewer:
NONE
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: