Commit b261d8c6 authored by Rohit Jnagal's avatar Rohit Jnagal

Merge pull request #4724 from mikedanese/readiness-states-cleanup

Don't lock readinessStates on concurrent reads
parents cbcd3553 d6fb8ce0
......@@ -162,7 +162,8 @@ func newReadinessStates() *readinessStates {
}
type readinessStates struct {
sync.Mutex
// guards states
sync.RWMutex
states map[string]bool
}
......@@ -174,8 +175,8 @@ func (r *readinessStates) IsReady(c api.ContainerStatus) bool {
}
func (r *readinessStates) get(key string) bool {
r.Lock()
defer r.Unlock()
r.RLock()
defer r.RUnlock()
state, found := r.states[key]
return state && found
}
......
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