Merge pull request #76229 from tedyu/master

Use read lock for PriorityQueue#PendingPods
This commit is contained in:
Kubernetes Prow Robot 2019-04-06 23:12:25 -07:00 committed by GitHub
commit 9600555969
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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