Skip to content

Commit

Permalink
Merge pull request kubernetes#73357 from tedyu/master
Browse files Browse the repository at this point in the history
Use read lock for scheduler_binder_cache GetDecisions
  • Loading branch information
k8s-ci-robot authored Jan 29, 2019
2 parents d9fbb9a + c8f1826 commit 2e90d92
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 2e90d92

Please sign in to comment.