Commit 4b4c20be authored by Ted Yu's avatar Ted Yu Committed by Ted Yu

Use read lock for PendingPods

parent 9c2df998
......@@ -702,8 +702,8 @@ func (p *PriorityQueue) NominatedPodsForNode(nodeName string) []*v1.Pod {
// PendingPods returns all the pending pods in the queue. This function is
// used for debugging purposes in the scheduler cache dumper and comparer.
func (p *PriorityQueue) PendingPods() []*v1.Pod {
p.lock.Lock()
defer p.lock.Unlock()
p.lock.RLock()
defer p.lock.RUnlock()
result := []*v1.Pod{}
for _, pInfo := range p.activeQ.List() {
result = append(result, pInfo.(*podInfo).pod)
......
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