Merge pull request #65339 from liggitt/taint-manager-memory

Automatic merge from submit-queue (batch tested with PRs 65339, 65343, 65324, 65335, 65367). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove item from taint manager workqueue on completion

fixes a memory leak observed in the controller manager when creating/deleting pods containing tolerations

xref #65325

```release-note
fixes a memory leak in the kube-controller-manager observed when large numbers of pods with tolerations are created/deleted
```
This commit is contained in:
Kubernetes Submit Queue 2018-06-22 10:31:10 -07:00 committed by GitHub
commit bece0d522c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -224,9 +224,11 @@ func (tc *NoExecuteTaintManager) Run(stopCh <-chan struct{}) {
hash := hash(nodeUpdate.name())
select {
case <-stopCh:
tc.nodeUpdateQueue.Done(item)
break
case tc.nodeUpdateChannels[hash%workers] <- nodeUpdate:
}
tc.nodeUpdateQueue.Done(item)
}
}(stopCh)
@ -240,9 +242,11 @@ func (tc *NoExecuteTaintManager) Run(stopCh <-chan struct{}) {
hash := hash(podUpdate.nodeName())
select {
case <-stopCh:
tc.podUpdateQueue.Done(item)
break
case tc.podUpdateChannels[hash%workers] <- podUpdate:
}
tc.podUpdateQueue.Done(item)
}
}(stopCh)