Use read lock for scheduler_binder_cache GetDecisions

This commit is contained in:
Ted Yu 2019-01-26 13:06:21 -08:00 committed by Ted Yu
parent 8d804ceb10
commit c8f1826185

View File

@ -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 {