Skip to content

Commit 605522b

Browse files
committed
Add explanation about forgetFunc in cacher
1 parent f6c51d6 commit 605522b

File tree

1 file changed

+2
-0
lines changed
  • staging/src/k8s.io/apiserver/pkg/storage/cacher

1 file changed

+2
-0
lines changed

staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,8 @@ func (c *Cacher) Watch(ctx context.Context, key string, resourceVersion string,
365365

366366
// Create a watcher here to reduce memory allocations under lock,
367367
// given that memory allocation may trigger GC and block the thread.
368+
// Also note that emptyFunc is a placeholder, until we will be able
369+
// to compute watcher.forget function (which has to happen under lock).
368370
watcher := newCacheWatcher(chanSize, filterWithAttrsFunction(key, pred), emptyFunc, c.versioner)
369371

370372
// We explicitly use thread unsafe version and do locking ourself to ensure that

0 commit comments

Comments
 (0)