Permalink
Browse files

Merge pull request #73357 from tedyu/master

Use read lock for scheduler_binder_cache GetDecisions
  • Loading branch information...
k8s-ci-robot committed Jan 29, 2019
2 parents d9fbb9a + c8f1826 commit 2e90d92db9a807fcc140977e7a4798c6078014c2
Showing with 2 additions and 2 deletions.
  1. +2 −2 pkg/controller/volume/persistentvolume/scheduler_binder_cache.go
@@ -74,8 +74,8 @@ func NewPodBindingCache() PodBindingCache {
}

func (c *podBindingCache) GetDecisions(pod *v1.Pod) nodeDecisions {
c.rwMutex.Lock()
defer c.rwMutex.Unlock()
c.rwMutex.RLock()
defer c.rwMutex.RUnlock()
podName := getPodName(pod)
decisions, ok := c.bindingDecisions[podName]
if !ok {

0 comments on commit 2e90d92

Please sign in to comment.