diff --git a/core/pkg/task/queue.go b/core/pkg/task/queue.go index e7fd0a848..d29f3c2c9 100644 --- a/core/pkg/task/queue.go +++ b/core/pkg/task/queue.go @@ -51,6 +51,11 @@ func (t *Queue) Run(period time.Duration, stopCh <-chan struct{}) { // Enqueue enqueues ns/name of the given api object in the task queue. func (t *Queue) Enqueue(obj interface{}) { + if t.IsShuttingDown() { + glog.Errorf("queue has been shutdown, failed to enqueue: %v", obj) + return + } + glog.V(3).Infof("queuing item %v", obj) key, err := t.fn(obj) if err != nil {