-
Notifications
You must be signed in to change notification settings - Fork 264
Automated cherry pick of #809: Prevent memory leak #811
Automated cherry pick of #809: Prevent memory leak #811
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: k82cn 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 |
@@ -482,6 +482,8 @@ func (sc *SchedulerCache) processCleanupJob() { | |||
return | |||
} | |||
|
|||
defer sc.deletedJobs.Done(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 there is something error in line 496, we'll try to delete it in line 501. If we defer delete it, it will be deleted at last, line 501 will take no effort.
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.
deleteJob
will add it to deletedJob
queue, as Done
is not executed, it's only marked as dirty in queue :)
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.
oh, there's still an issue that after delete(sc.Jobs, job.UID)
, we should forget job in reateLimitedQueue.
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 forget method for DefaultControllerRateLimiter
is empty, have no effect.
func (r *BucketRateLimiter) Forget(item interface{}) {
}
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.
It's better to include to align with its description in interface.
/lgtm |
Cherry pick of #809 on release-0.4.
#809: Prevent memory leak