@@ -661,6 +661,7 @@ func (c *Cacher) Watch(ctx context.Context, key string, opts storage.ListOptions
661
661
}
662
662
663
663
addedWatcher := false
664
+ fmt .Printf ("#### 1n groupResource=%v \n " , c .groupResource )
664
665
func () {
665
666
c .Lock ()
666
667
defer c .Unlock ()
@@ -673,19 +674,24 @@ func (c *Cacher) Watch(ctx context.Context, key string, opts storage.ListOptions
673
674
return
674
675
}
675
676
677
+ fmt .Printf ("#### 1p groupResource=%v \n " , c .groupResource )
676
678
// Update watcher.forget function once we can compute it.
677
679
watcher .forget = forgetWatcher (c , watcher , c .watcherIdx , scope , triggerValue , triggerSupported )
678
680
// Update the bookMarkAfterResourceVersion
679
681
watcher .setBookmarkAfterResourceVersion (bookmarkAfterResourceVersionFn ())
680
682
c .watchers .addWatcher (watcher , c .watcherIdx , scope , triggerValue , triggerSupported )
681
683
addedWatcher = true
682
684
685
+ fmt .Printf ("#### 1q groupResource=%v \n " , c .groupResource )
683
686
// Add it to the queue only when the client support watch bookmarks.
684
687
if watcher .allowWatchBookmarks {
685
688
c .bookmarkWatchers .addWatcherThreadUnsafe (watcher )
686
689
}
687
690
c .watcherIdx ++
691
+
692
+ fmt .Printf ("#### 1r groupResource=%v \n " , c .groupResource )
688
693
}()
694
+ fmt .Printf ("#### 1s groupResource=%v \n " , c .groupResource )
689
695
690
696
if ! addedWatcher {
691
697
fmt .Printf ("#### 1x groupResource=%v returning the immediate closer thing\n " , c .groupResource )
@@ -696,6 +702,7 @@ func (c *Cacher) Watch(ctx context.Context, key string, opts storage.ListOptions
696
702
return newImmediateCloseWatcher (), nil
697
703
}
698
704
705
+ fmt .Printf ("#### 1y groupResource=%v \n " , c .groupResource )
699
706
go watcher .processInterval (ctx , cacheInterval , requiredResourceVersion )
700
707
return watcher , nil
701
708
}
@@ -1342,13 +1349,18 @@ func forgetWatcher(c *Cacher, w *cacheWatcher, index int, scope namespacedName,
1342
1349
c .Lock ()
1343
1350
defer c .Unlock ()
1344
1351
1352
+ fmt .Printf ("#### 3a groupResource=%v \n " , c .groupResource )
1353
+
1345
1354
w .setDrainInputBufferLocked (drainWatcher )
1355
+ fmt .Printf ("#### 3b groupResource=%v \n " , c .groupResource )
1346
1356
1347
1357
// It's possible that the watcher is already not in the structure (e.g. in case of
1348
1358
// simultaneous Stop() and terminateAllWatchers(), but it is safe to call stopLocked()
1349
1359
// on a watcher multiple times.
1350
1360
c .watchers .deleteWatcher (index , scope , triggerValue , triggerSupported )
1361
+ fmt .Printf ("#### 3c groupResource=%v \n " , c .groupResource )
1351
1362
c .stopWatcherLocked (w )
1363
+ fmt .Printf ("#### 3d groupResource=%v \n " , c .groupResource )
1352
1364
}
1353
1365
}
1354
1366
0 commit comments