From 04a40d1f1810b8eb647fd1e0a63d88d337c326a2 Mon Sep 17 00:00:00 2001 From: Wei Huang Date: Wed, 10 Feb 2021 11:02:44 -0800 Subject: [PATCH] sched: remove Unknown queuing literal --- pkg/scheduler/eventhandlers.go | 10 ++-------- pkg/scheduler/internal/queue/events.go | 6 ++---- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/pkg/scheduler/eventhandlers.go b/pkg/scheduler/eventhandlers.go index 1c7a5b09994..edf6378de72 100755 --- a/pkg/scheduler/eventhandlers.go +++ b/pkg/scheduler/eventhandlers.go @@ -118,14 +118,8 @@ func (sched *Scheduler) updateNodeInCache(oldObj, newObj interface{}) { klog.Errorf("scheduler cache UpdateNode failed: %v", err) } - // Only activate unschedulable pods if the node became more schedulable. - // We skip the node property comparison when there is no unschedulable pods in the queue - // to save processing cycles. We still trigger a move to active queue to cover the case - // that a pod being processed by the scheduler is determined unschedulable. We want this - // pod to be reevaluated when a change in the cluster happens. - if sched.SchedulingQueue.NumUnschedulablePods() == 0 { - sched.SchedulingQueue.MoveAllToActiveOrBackoffQueue(queue.Unknown) - } else if event := nodeSchedulingPropertiesChange(newNode, oldNode); event != "" { + // Only requeue unschedulable pods if the node became more schedulable. + if event := nodeSchedulingPropertiesChange(newNode, oldNode); event != "" { sched.SchedulingQueue.MoveAllToActiveOrBackoffQueue(event) } } diff --git a/pkg/scheduler/internal/queue/events.go b/pkg/scheduler/internal/queue/events.go index 44440f7fb3a..5c0f1b119d3 100644 --- a/pkg/scheduler/internal/queue/events.go +++ b/pkg/scheduler/internal/queue/events.go @@ -18,8 +18,6 @@ package queue // Events that trigger scheduler queue to change. const ( - // Unknown event - Unknown = "Unknown" // PodAdd is the event when a new pod is added to API server. PodAdd = "PodAdd" // NodeAdd is the event when a new node is added to the cluster. @@ -63,9 +61,9 @@ const ( NodeSpecUnschedulableChange = "NodeSpecUnschedulableChange" // NodeAllocatableChange is the event when node allocatable is changed. NodeAllocatableChange = "NodeAllocatableChange" - // NodeLabelsChange is the event when node label is changed. + // NodeLabelChange is the event when node label is changed. NodeLabelChange = "NodeLabelChange" - // NodeTaintsChange is the event when node taint is changed. + // NodeTaintChange is the event when node taint is changed. NodeTaintChange = "NodeTaintChange" // NodeConditionChange is the event when node condition is changed. NodeConditionChange = "NodeConditionChange"