mirror of
https://github.com/kubernetes/client-go.git
synced 2026-05-17 04:52:18 +00:00
Fix workqueue memory leak
Kubernetes-commit: ce38e02bb58929a965476c478476d1d8957e20c0
This commit is contained in:
committed by
Kubernetes Publisher
parent
7e4462aced
commit
f7fb3aa62b
@@ -149,7 +149,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