diff --git a/staging/src/k8s.io/apiserver/pkg/storage/cacher.go b/staging/src/k8s.io/apiserver/pkg/storage/cacher.go index 27ead5a1d78..36334a3662b 100644 --- a/staging/src/k8s.io/apiserver/pkg/storage/cacher.go +++ b/staging/src/k8s.io/apiserver/pkg/storage/cacher.go @@ -655,7 +655,7 @@ func (c *Cacher) Stop() { } c.stopLock.Lock() if c.stopped { - // avoid that it was locked meanwhile as isStopped only read-locks + c.stopLock.Unlock() return } c.stopped = true @@ -676,7 +676,7 @@ func forgetWatcher(c *Cacher, index int, triggerValue string, triggerSupported b glog.V(1).Infof("Forcing watcher close due to unresponsiveness: %v", c.objectType.String()) } // It's possible that the watcher is already not in the structure (e.g. in case of - // simulaneous Stop() and terminateAllWatchers(), but it doesn't break anything. + // simultaneous Stop() and terminateAllWatchers(), but it doesn't break anything. c.watchers.deleteWatcher(index, triggerValue, triggerSupported) } } @@ -747,7 +747,7 @@ func (lw *cacherListerWatcher) Watch(options metav1.ListOptions) (watch.Interfac return lw.storage.WatchList(context.TODO(), lw.resourcePrefix, options.ResourceVersion, Everything) } -// cacherWatch implements watch.Interface to return a single error +// errWatcher implements watch.Interface to return a single error type errWatcher struct { result chan watch.Event } @@ -787,7 +787,7 @@ func (c *errWatcher) Stop() { // no-op } -// cacherWatch implements watch.Interface +// cachWatcher implements watch.Interface type cacheWatcher struct { sync.Mutex input chan *watchCacheEvent