mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 14:07:14 +00:00
Merge pull request #30368 from wojtek-t/log_terminating_all_watchers
Automatic merge from submit-queue Log warning when terminating all watchers Ref #30275 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/30368) <!-- Reviewable:end -->
This commit is contained in:
commit
a69054f9c3
@ -138,6 +138,9 @@ type Cacher struct {
|
|||||||
// Underlying storage.Interface.
|
// Underlying storage.Interface.
|
||||||
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.
|
// "sliding window" of recent changes of objects and the current state.
|
||||||
watchCache *watchCache
|
watchCache *watchCache
|
||||||
reflector *cache.Reflector
|
reflector *cache.Reflector
|
||||||
@ -181,6 +184,7 @@ func NewCacherFromConfig(config CacherConfig) *Cacher {
|
|||||||
cacher := &Cacher{
|
cacher := &Cacher{
|
||||||
ready: newReady(),
|
ready: newReady(),
|
||||||
storage: config.Storage,
|
storage: config.Storage,
|
||||||
|
objectType: reflect.TypeOf(config.Type),
|
||||||
watchCache: watchCache,
|
watchCache: watchCache,
|
||||||
reflector: cache.NewReflector(listerWatcher, config.Type, watchCache, 0),
|
reflector: cache.NewReflector(listerWatcher, config.Type, watchCache, 0),
|
||||||
versioner: config.Versioner,
|
versioner: config.Versioner,
|
||||||
@ -435,6 +439,7 @@ func (c *Cacher) processEvent(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()
|
||||||
|
Loading…
Reference in New Issue
Block a user