From 0f4a6cf319d5815ce7932fa017ef0d9c87c659b4 Mon Sep 17 00:00:00 2001 From: Alexander Zielenski <351783+alexzielenski@users.noreply.github.com> Date: Mon, 8 Aug 2022 14:19:37 -0700 Subject: [PATCH] reset listenersStarted for correctness. technically shouldnt be an issue since restarting a stopped processor is not supported Kubernetes-commit: 3a81341cfa6f7e2ca1b9bfc195c567dcdfaa4dea --- tools/cache/shared_informer.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/cache/shared_informer.go b/tools/cache/shared_informer.go index 56c19b10..c7d6d1f1 100644 --- a/tools/cache/shared_informer.go +++ b/tools/cache/shared_informer.go @@ -754,6 +754,10 @@ func (p *sharedProcessor) run(stopCh <-chan struct{}) { // Wipe out list of listeners since they are now closed // (processorListener cannot be re-used) p.listeners = nil + + // Reset to false since there are nil listeners, also to block new listeners + // that are added from being run now that the processor was stopped + p.listenersStarted = false }() p.wg.Wait() // Wait for all .pop() and .run() to stop