From 497f891cfb3072c558cdec8d327c68173a592c6d Mon Sep 17 00:00:00 2001 From: Wojciech Tyczynski Date: Wed, 10 Aug 2016 17:04:10 +0200 Subject: [PATCH] Log warning when terminating all watchers --- pkg/storage/cacher.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/storage/cacher.go b/pkg/storage/cacher.go index 311622289a1..de9dd8fa25b 100644 --- a/pkg/storage/cacher.go +++ b/pkg/storage/cacher.go @@ -138,6 +138,9 @@ type Cacher struct { // Underlying storage.Interface. storage Interface + // Expected type of objects in the underlying cache. + objectType reflect.Type + // "sliding window" of recent changes of objects and the current state. watchCache *watchCache reflector *cache.Reflector @@ -181,6 +184,7 @@ func NewCacherFromConfig(config CacherConfig) *Cacher { cacher := &Cacher{ ready: newReady(), storage: config.Storage, + objectType: reflect.TypeOf(config.Type), watchCache: watchCache, reflector: cache.NewReflector(listerWatcher, config.Type, watchCache, 0), versioner: config.Versioner, @@ -440,6 +444,7 @@ func (c *Cacher) processEvent(event watchCacheEvent) { } func (c *Cacher) terminateAllWatchers() { + glog.Warningf("Terminating all watchers from cacher %v", c.objectType) c.Lock() defer c.Unlock() c.watchers.terminateAll()