Merge pull request #94083 from soulxu/shrink_lock_scope

Only lock statuses map when status isn't successful
This commit is contained in:
Kubernetes Prow Robot 2020-08-27 16:07:57 -07:00 committed by GitHub
commit 9bba0390ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -333,11 +333,11 @@ func (g *genericScheduler) findNodesThatPassFilters(ctx context.Context, prof *p
feasibleNodes[length-1] = nodeInfo.Node()
}
} else {
statusesLock.Lock()
if !status.IsSuccess() {
statusesLock.Lock()
statuses[nodeInfo.Node().Name] = status
statusesLock.Unlock()
}
statusesLock.Unlock()
}
}