From f620bd48b57445efc54f36670ceeff334a8f3263 Mon Sep 17 00:00:00 2001 From: Dan Ramich Date: Wed, 15 Apr 2020 17:23:46 -0700 Subject: [PATCH] Drop things from the queue when completed --- pkg/clustercache/controller.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/clustercache/controller.go b/pkg/clustercache/controller.go index f879323..59cbe2d 100644 --- a/pkg/clustercache/controller.go +++ b/pkg/clustercache/controller.go @@ -216,6 +216,7 @@ func (h *clusterCache) List(gvr schema2.GroupVersionResource) []interface{} { } func (h *clusterCache) start() { + defer h.workqueue.ShutDown() for { eventObj, ok := h.workqueue.Get() if ok { @@ -227,6 +228,7 @@ func (h *clusterCache) start() { w := h.watchers[event.gvr] h.RUnlock() if w == nil { + h.workqueue.Done(eventObj) continue } @@ -247,6 +249,7 @@ func (h *clusterCache) start() { logrus.Errorf("failed to handle remove event: %v", err) } } + h.workqueue.Done(eventObj) } }