-
Notifications
You must be signed in to change notification settings - Fork 40.9k
Fix data race in scheduling post start hook #132692
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Monis Khan <mok@microsoft.com>
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
LGTM label has been added. Git tree hash: fa62dff3371f4c4448414a01693e223cb38842a7
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: aramase, enj The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@enj: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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-sigs/prow repository. I understand the commands that are listed here. |
@@ -90,7 +90,8 @@ func AddSystemPriorityClasses() genericapiserver.PostStartHookFunc { | |||
_, err := schedClientSet.PriorityClasses().Get(context.TODO(), pc.Name, metav1.GetOptions{}) |
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.
How about pc.Name
, would it cause data race?
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.
pc.Name is ok. the root cause can refer to this issue #82497
@enj Please follow the rules of PR description. Especially, the |
@@ -90,7 +90,8 @@ func AddSystemPriorityClasses() genericapiserver.PostStartHookFunc { | |||
_, err := schedClientSet.PriorityClasses().Get(context.TODO(), pc.Name, metav1.GetOptions{}) | |||
if err != nil { | |||
if apierrors.IsNotFound(err) { | |||
_, err := schedClientSet.PriorityClasses().Create(context.TODO(), pc, metav1.CreateOptions{}) | |||
// create can mutate its input so we deep copy pc here since it is a global |
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 think we can add the comment similar to this PR: https://github.com/kubernetes/kubernetes/pull/117107/files#diff-c2faa7dc1df07c6ec299bad68c04fb0b1623a0fd09219896bb919110aae8cbbdR121-R123. It’s the same root cause.
/kind bug