-
Notifications
You must be signed in to change notification settings - Fork 963
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
add lock before read Jobs map #3478 #3479
add lock before read Jobs map #3478 #3479
Conversation
Welcome @Wang-Kai! |
@@ -258,6 +258,8 @@ func (sc *SchedulerCache) syncTask(oldTask *schedulingapi.TaskInfo) error { | |||
newPod, err := sc.kubeClient.CoreV1().Pods(oldTask.Namespace).Get(context.TODO(), oldTask.Name, metav1.GetOptions{}) | |||
if err != nil { | |||
if errors.IsNotFound(err) { | |||
sc.Mutex.Lock() |
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 not sure if we need to use lock in notfound error as well. this error is not common, but it works if we add it.
nice catch! :)
@Wang-Kai DCO signature is required when submitting a commit! |
/ok-to-test |
Hi, please sign off you commit with |
Sorry for the delay. I just executed the |
2f36fb4
to
acb43cb
Compare
Please rebase and squash commits to only one. |
Signed-off-by: 王凯 <[email protected]>
6e274a7
to
6ffc12d
Compare
/lgtm |
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.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: william-wang 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 |
add lock before read Jobs map in syncTask function