Skip to content
This repository has been archived by the owner on May 25, 2023. It is now read-only.

Automated cherry pick of #809: Prevent memory leak #811

Merged
merged 1 commit into from
Apr 22, 2019
Merged

Automated cherry pick of #809: Prevent memory leak #811

merged 1 commit into from
Apr 22, 2019

Conversation

k82cn
Copy link
Contributor

@k82cn k82cn commented Apr 21, 2019

Cherry pick of #809 on release-0.4.

#809: Prevent memory leak

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 21, 2019
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 21, 2019
@@ -482,6 +482,8 @@ func (sc *SchedulerCache) processCleanupJob() {
return
}

defer sc.deletedJobs.Done(obj)
Copy link
Contributor

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.

Copy link
Contributor Author

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 :)

Copy link
Contributor Author

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.

@hzxuzhonghu

Copy link
Contributor

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{}) {
}

Copy link
Contributor Author

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.

@hzxuzhonghu
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 22, 2019
@k8s-ci-robot k8s-ci-robot merged commit 8613522 into kubernetes-retired:release-0.4 Apr 22, 2019
@k82cn k82cn deleted the automated-cherry-pick-of-#809-upstream-release-0.4 branch April 22, 2019 09:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants