-
Notifications
You must be signed in to change notification settings - Fork 40.2k
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
Replace stat syscall with statx #119968
Replace stat syscall with statx #119968
Conversation
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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. |
Hi @j4ckstraw. 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. |
606ad88
to
a8d03fe
Compare
var stat, rootStat unix.Statx_t | ||
var err error | ||
|
||
if stat, err = statx(file); 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 be better to reuse MountFast that needs 5.6 ?
It falls back to stat()
, but only in < 5.6
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.
I'm afraid not, because normalizePath will call Stat again.
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.
rather than falling back to IsMountPoint
- should it fall back to a implementation of IsLikelyNotMountPoint
which uses stat
?
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.
Sorry, I don't understand what you mean.
The key point here is that stat
syscall will trap in kernel, which make kubelet struck in main loop. So I replace stat
with statx
. AT_STATX_DONT_SYNC option make statx don't sync with remote nfs server, so will not trap in kernel.
English is not my native language. Please forgive me if there are any grammatical mistakes :)
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 catch. IMO it would make sense to use statx
in moby's normalizePath
then
@kolyshkin, WDYT?
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.
@j4ckstraw I was saying on kernels that don't support statx
syscalls, rather than going to IsMountPoint
which is slow and could be considered a regression in certain environments, we fall back to an implementation of IsLikelyNotMountPoint
which still uses stat
and yes, it will get kubelet stuck but it at least behave same as older version and will not be considered a regression.
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.
@gnufied OK, I see. I agree with you, regression is bad, I will try to file a new patch. thank you for your comments.
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.
@gnufied Updated, it's fallback to origin IsLikelyNotMountPoint
now.
As you can see, I change the comment of IsLikelyNotMountPoint
, I change the semantic of the IsLikelyNotMountPoint
in the last patch, so it is reliable, but with risk of regression and slow if the kernel not support statx
.
After updated, it may be free of regression, but still have risk of making kubelet struck in main loop.
WDYT?
ae92858
to
e47a132
Compare
@jingxu97 Do you have time to take a look at this? |
thanks, this is looking good. Can you also add some tests while we are are at it? |
|
I've been busy with other things, sorry for the late reply. |
/ok-to-test |
/retest |
statx with AT_STATX_DONT_SYNC will not stuck kubelet syncLoop. Signed-off-by: j4ckstraw <j4ckstraw@foxmail.com> fix remove useless comment Signed-off-by: j4ckstraw <j4ckstraw@foxmail.com>
I agree with you. |
@j4ckstraw I cherry-picked your commit to our branch, on Linux 4.18, we found that the |
@249043822 If no cherry-pick, whether there is a nested mount |
No, it's normal |
Signed-off-by: j4ckstraw <j4ckstraw@foxmail.com>
Signed-off-by: j4ckstraw <j4ckstraw@foxmail.com>
/test pull-kubernetes-node-e2e-containerd |
/lgtm |
LGTM label has been added. Git tree hash: 9d7a7289f31ee79dc8014877ab3efcfb62fe19e2
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: j4ckstraw, 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 |
Fix: IsLikelyNotMountPoint hangs forever if nfs server unreachable. See kubernetes/kubernetes#119968
Fix: IsLikelyNotMountPoint hangs forever if nfs server unreachable. See kubernetes/kubernetes#119968
Fix: IsLikelyNotMountPoint hangs forever if nfs server unreachable. See kubernetes/kubernetes#119968
Fix: IsLikelyNotMountPoint hangs forever if nfs server unreachable. See kubernetes/kubernetes#119968
Fix: IsLikelyNotMountPoint hangs forever if nfs server unreachable. See kubernetes/kubernetes#119968
Fix: IsLikelyNotMountPoint hangs forever if nfs server unreachable. See kubernetes/kubernetes#119968
statx with AT_STATX_DONT_SYNC will not stuck kubelet syncLoop.
stat will stuck in syscall when nfs server not responding, replace stat with statx to fix it.
What type of PR is this?
/kind bug
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #101622
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: