Skip to content

Commit 6f3f115

Browse files
authored
Merge pull request kubernetes#126222 from macsko/dont_lock_activeq_twice_in_activate_in_scheduling_queue
Don't lock activeQ twice when activating pod in scheduling queue
2 parents acaec0c + 7421ded commit 6f3f115

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

pkg/scheduler/internal/queue/scheduling_queue.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -660,17 +660,12 @@ func (p *PriorityQueue) existsInActiveQ(pInfo *framework.QueuedPodInfo) bool {
660660
}
661661

662662
func (p *PriorityQueue) activate(logger klog.Logger, pod *v1.Pod) bool {
663-
// Verify if the pod is present in activeQ.
664-
if p.existsInActiveQ(newQueuedPodInfoForLookup(pod)) {
665-
// No need to activate if it's already present in activeQ.
666-
return false
667-
}
668663
var pInfo *framework.QueuedPodInfo
669664
// Verify if the pod is present in unschedulablePods or backoffQ.
670665
if pInfo = p.unschedulablePods.get(pod); pInfo == nil {
671666
// If the pod doesn't belong to unschedulablePods or backoffQ, don't activate it.
667+
// The pod can be already in activeQ.
672668
if obj, exists, _ := p.podBackoffQ.Get(newQueuedPodInfoForLookup(pod)); !exists {
673-
logger.Error(nil, "To-activate pod does not exist in unschedulablePods or backoffQ", "pod", klog.KObj(pod))
674669
return false
675670
} else {
676671
pInfo = obj.(*framework.QueuedPodInfo)

0 commit comments

Comments
 (0)