Merge pull request #117154 from p0lyn0mial/upstream-cacher-size-rlock

watchcache: currentCapacity acquires a read lock

Kubernetes-commit: 6262d253719213503ce4d9b887fb39700975b8a8
This commit is contained in:
Kubernetes Publisher 2023-04-11 21:17:12 -07:00
commit 98ef921952
1 changed files with 2 additions and 2 deletions

View File

@ -608,8 +608,8 @@ func (w *watchCache) Resync() error {
}
func (w *watchCache) currentCapacity() int {
w.Lock()
defer w.Unlock()
w.RLock()
defer w.RUnlock()
return w.capacity
}