Commit 0a62dab5 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #32645 from wojtek-t/fix_cacher_logging

Automatic merge from submit-queue Fix logging in cacher @smarterclayton @liggitt @hongchaodeng
parents e3f0ce23 e5b3f196
...@@ -113,7 +113,10 @@ func (i *indexedWatchers) deleteWatcher(number int, value string, supported bool ...@@ -113,7 +113,10 @@ func (i *indexedWatchers) deleteWatcher(number int, value string, supported bool
} }
} }
func (i *indexedWatchers) terminateAll() { func (i *indexedWatchers) terminateAll(objectType reflect.Type) {
if len(i.allWatchers) > 0 || len(i.valueWatchers) > 0 {
glog.Warningf("Terminating all watchers from cacher %v", objectType)
}
i.allWatchers.terminateAll() i.allWatchers.terminateAll()
for index, watchers := range i.valueWatchers { for index, watchers := range i.valueWatchers {
watchers.terminateAll() watchers.terminateAll()
...@@ -465,10 +468,9 @@ func (c *Cacher) dispatchEvent(event *watchCacheEvent) { ...@@ -465,10 +468,9 @@ func (c *Cacher) dispatchEvent(event *watchCacheEvent) {
} }
func (c *Cacher) terminateAllWatchers() { func (c *Cacher) terminateAllWatchers() {
glog.Warningf("Terminating all watchers from cacher %v", c.objectType)
c.Lock() c.Lock()
defer c.Unlock() defer c.Unlock()
c.watchers.terminateAll() c.watchers.terminateAll(c.objectType)
} }
func (c *Cacher) isStopped() bool { func (c *Cacher) isStopped() bool {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment