mirror of
https://github.com/kubernetes/client-go.git
synced 2025-12-26 14:42:27 +00:00
Fix workqueue memory leak
Kubernetes-commit: ccc8303df1970632e9ce8576f24ca5b20115f5fa
This commit is contained in:
committed by
Kubernetes Publisher
parent
81c3757ed9
commit
7f47bbe3fe
@@ -155,7 +155,10 @@ func (q *Type) Get() (item interface{}, shutdown bool) {
|
||||
return nil, true
|
||||
}
|
||||
|
||||
item, q.queue = q.queue[0], q.queue[1:]
|
||||
item = q.queue[0]
|
||||
// The underlying array still exists and reference this object, so the object will not be garbage collected.
|
||||
q.queue[0] = nil
|
||||
q.queue = q.queue[1:]
|
||||
|
||||
q.metrics.get(item)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user