Unverified Commit 2e90d92d authored by Kubernetes Prow Robot's avatar Kubernetes Prow Robot Committed by GitHub

Merge pull request #73357 from tedyu/master

Use read lock for scheduler_binder_cache GetDecisions
parents d9fbb9af c8f18261
...@@ -74,8 +74,8 @@ func NewPodBindingCache() PodBindingCache { ...@@ -74,8 +74,8 @@ func NewPodBindingCache() PodBindingCache {
} }
func (c *podBindingCache) GetDecisions(pod *v1.Pod) nodeDecisions { func (c *podBindingCache) GetDecisions(pod *v1.Pod) nodeDecisions {
c.rwMutex.Lock() c.rwMutex.RLock()
defer c.rwMutex.Unlock() defer c.rwMutex.RUnlock()
podName := getPodName(pod) podName := getPodName(pod)
decisions, ok := c.bindingDecisions[podName] decisions, ok := c.bindingDecisions[podName]
if !ok { if !ok {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment