-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Kubelet: per-pod workers should avoid grabbing the pod array lock #5685
Conversation
I assume I was summoned by accident. |
Yes, my apology. I meant to cc/ @fgrzadkowski I don't know a good way to unsubscribe from a github issue once you've mentioned, so apologize again for the future noise... |
if !found { | ||
return api.PodStatus{}, fmt.Errorf("Couldn't find spec for pod %s", podFullName) | ||
return api.PodStatus{}, fmt.Errorf("Couldn't find pod %s", podFullName) |
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.
nit: I know you didn't change it but: errors should start with lowercase and can qe use %q instead of %s? I find it helps in cases when whitespace and empty strings are concerned.
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.
Agreed. Changed this and more.
LGTM, just a minor nit |
Per-pod worker syncs the pod and container status, and write the pod status in the pod status cache. Given that it already owns a copy of the pod, it can bypass the additional pod lookup step completely. This change adds a new generatePodStatusByPod() method to achieve this. In general, per-pod worker should avoid accessing the internal pod array completely, as this would may lead to high contention. This change also changes the return type of GetPodByFullName to reflect the name, and consolidates GetPodByFullName() and GetPodByName().
Addressed the nit. Thanks! |
LGTM, thanks @yujuhong and thanks for fixing the nits! |
Kubelet: per-pod workers should avoid grabbing the pod array lock
Per-pod worker syncs the pod and container status, and write the pod status in
the pod status cache. Given that it already owns a copy of the pod, it can
bypass the additional pod lookup step completely. This change adds a new
generatePodStatusByPod() method to achieve this. In general, per-pod worker
should avoid accessing the internal pod array completely, as this would may
lead to high contention.
This change also changes the return type of GetPodByFullName to reflect the
name, and consolidates GetPodByFullName() and GetPodByName().