Skip to content

Commit 312eb89

Browse files
authored
Merge pull request kubernetes#75760 from wojtek-t/follow_comment_from_critical_sections
Add explanation about forgetFunc in cacher
2 parents a519e91 + 605522b commit 312eb89

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)