Skip to content

Commit 2c4dc6b

Browse files
committed
elaborate comments
1 parent dd3af9a commit 2c4dc6b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pkg/scheduler/internal/queue/scheduling_queue.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,8 +1194,14 @@ func (p *PriorityQueue) movePodsToActiveOrBackoffQueue(logger klog.Logger, podIn
11941194

11951195
activated := false
11961196
for _, pInfo := range podInfoList {
1197-
// Since there may be many gated pods and they will not move from the
1198-
// unschedulable pool, we skip calling the expensive isPodWorthRequeueing.
1197+
// Scheduling-gated Pods never get schedulable with any events,
1198+
// except the Pods themselves got updated, which isn't handled by movePodsToActiveOrBackoffQueue.
1199+
// So, here we skip them early here so that they don't go through isPodWorthRequeuing,
1200+
// which isn't fast enough when the number of scheduling-gated Pods in unschedulablePods is large.
1201+
//
1202+
// Note that we cannot skip all pInfo.Gated Pods here
1203+
// because PreEnqueue plugins apart from the scheduling gate plugin may change the gating status
1204+
// with these events.
11991205
if pInfo.Gated && pInfo.UnschedulablePlugins.Has(names.SchedulingGates) {
12001206
continue
12011207
}

0 commit comments

Comments
 (0)