From 7421ded6f95e155fe61579c0d0f05dd046feb5d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Skocze=C5=84?= Date: Fri, 19 Jul 2024 09:18:42 +0000 Subject: [PATCH] Don't lock activeQ twice when activating pod in scheduling queue --- pkg/scheduler/internal/queue/scheduling_queue.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pkg/scheduler/internal/queue/scheduling_queue.go b/pkg/scheduler/internal/queue/scheduling_queue.go index 5e3a77cbca3..a54967626ee 100644 --- a/pkg/scheduler/internal/queue/scheduling_queue.go +++ b/pkg/scheduler/internal/queue/scheduling_queue.go @@ -660,17 +660,12 @@ func (p *PriorityQueue) existsInActiveQ(pInfo *framework.QueuedPodInfo) bool { } func (p *PriorityQueue) activate(logger klog.Logger, pod *v1.Pod) bool { - // Verify if the pod is present in activeQ. - if p.existsInActiveQ(newQueuedPodInfoForLookup(pod)) { - // No need to activate if it's already present in activeQ. - return false - } var pInfo *framework.QueuedPodInfo // Verify if the pod is present in unschedulablePods or backoffQ. if pInfo = p.unschedulablePods.get(pod); pInfo == nil { // If the pod doesn't belong to unschedulablePods or backoffQ, don't activate it. + // The pod can be already in activeQ. if obj, exists, _ := p.podBackoffQ.Get(newQueuedPodInfoForLookup(pod)); !exists { - logger.Error(nil, "To-activate pod does not exist in unschedulablePods or backoffQ", "pod", klog.KObj(pod)) return false } else { pInfo = obj.(*framework.QueuedPodInfo)