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

Commit

Permalink
Merge pull request #809 from hzxuzhonghu/sched
Browse files Browse the repository at this point in the history
Prevent memory leak
  • Loading branch information
k8s-ci-robot authored Apr 20, 2019
2 parents 63b4dbc + fe71c70 commit 19f95af
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/scheduler/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,8 @@ func (sc *SchedulerCache) processCleanupJob() {
return
}

defer sc.deletedJobs.Done(obj)

job, found := obj.(*kbapi.JobInfo)
if !found {
glog.Errorf("Failed to convert <%v> to *JobInfo", obj)
Expand Down Expand Up @@ -516,6 +518,9 @@ func (sc *SchedulerCache) processResyncTask() {
if shutdown {
return
}

defer sc.errTasks.Done(obj)

task, ok := obj.(*kbapi.TaskInfo)
if !ok {
glog.Errorf("failed to convert %v to *v1.Pod", obj)
Expand Down

0 comments on commit 19f95af

Please sign in to comment.