-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix errTask channel memory leak #3434
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 errTask channel memory leak #3434
Conversation
dc1310a to
73ccfed
Compare
Signed-off-by: Wenbo Zhang <[email protected]>
73ccfed to
3da501f
Compare
pkg/scheduler/cache/cache.go
Outdated
| sc.resyncTask(task) | ||
| reSynced = true | ||
| } else { | ||
| klog.V(4).Infof("sync task <%s/%s> success", task.Namespace, task.Name) |
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.
Successfully synced task xxx
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.
done
| reSynced = true | ||
| } else { | ||
| klog.V(4).Infof("sync task <%s/%s> success", task.Namespace, task.Name) | ||
| sc.errTasks.Forget(obj) |
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.
If CustomBindErrHandler execute successfully, we should also forget it.
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.
We have forgot it when sync task successfully, just need resync task when CustomBindErrHandler execute failed
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.
Ok.
| } else { | ||
| jobErr = fmt.Errorf("failed to find Job <%v> for Task %v/%v", | ||
| pi.Job, pi.Namespace, pi.Name) | ||
| klog.Warningf("failed to find job <%v> for Task <%v/%v>", pi.Job, pi.Namespace, pi.Name) |
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.
Uppper case here.
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.
done
| taskKey, ok := obj.(string) | ||
| if !ok { | ||
| klog.Errorf("failed to convert %v to *schedulingapi.TaskInfo", obj) | ||
| klog.Errorf("Failed to convert %v to string.", obj) |
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.
The obj format is incorrect. Is it more reasonable to exclude Forget?
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.
done
|
Should also merge to master. |
Signed-off-by: Wenbo Zhang <[email protected]>
e5decd5 to
1693cb0
Compare
|
/lgtm |
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Current errTask has some problems as follows:
this PR fix these problems