diff --git a/pkg/scheduler/framework/interface.go b/pkg/scheduler/framework/interface.go index cf743e53956..1ad31c8e96e 100644 --- a/pkg/scheduler/framework/interface.go +++ b/pkg/scheduler/framework/interface.go @@ -180,7 +180,7 @@ type Status struct { reasons []string err error // failedPlugin is an optional field that records the plugin name a Pod failed by. - // It's set by the framework when code is Unschedulable or UnschedulableAndUnresolvable. + // It's set by the framework when code is Unschedulable, UnschedulableAndUnresolvable or Pending. failedPlugin string } diff --git a/pkg/scheduler/framework/types.go b/pkg/scheduler/framework/types.go index 3dc818541aa..8a64e7c9cec 100644 --- a/pkg/scheduler/framework/types.go +++ b/pkg/scheduler/framework/types.go @@ -304,7 +304,7 @@ const ( NoNodeAvailableMsg = "0/%v nodes are available" ) -func (d *Diagnosis) SetFailedPlugin(sts *Status) { +func (d *Diagnosis) AddPluginStatus(sts *Status) { if sts.FailedPlugin() == "" { return } diff --git a/pkg/scheduler/internal/queue/scheduling_queue.go b/pkg/scheduler/internal/queue/scheduling_queue.go index b0c970dcaca..66c01970c69 100644 --- a/pkg/scheduler/internal/queue/scheduling_queue.go +++ b/pkg/scheduler/internal/queue/scheduling_queue.go @@ -451,7 +451,7 @@ func (p *PriorityQueue) isPodWorthRequeuing(logger klog.Logger, pInfo *framework continue } - h, err := hintfn.QueueingHintFn(logger, pod, oldObj, newObj) + hint, err := hintfn.QueueingHintFn(logger, pod, oldObj, newObj) if err != nil { // If the QueueingHintFn returned an error, we should treat the event as Queue so that we can prevent // the Pod from being stuck in the unschedulable pod pool. @@ -461,9 +461,9 @@ func (p *PriorityQueue) isPodWorthRequeuing(logger klog.Logger, pInfo *framework } else { logger.Error(err, "QueueingHintFn returns error", "event", event, "plugin", hintfn.PluginName, "pod", klog.KObj(pod), "oldObj", klog.KObj(oldObjMeta), "newObj", klog.KObj(newObjMeta)) } - h = framework.Queue + hint = framework.Queue } - if h == framework.QueueSkip { + if hint == framework.QueueSkip { continue } diff --git a/pkg/scheduler/schedule_one.go b/pkg/scheduler/schedule_one.go index 33a1a7a89c6..26e7ef71433 100644 --- a/pkg/scheduler/schedule_one.go +++ b/pkg/scheduler/schedule_one.go @@ -214,7 +214,7 @@ func (sched *Scheduler) schedulingCycle( NodeToStatusMap: framework.NodeToStatusMap{scheduleResult.SuggestedHost: sts}, }, } - fitErr.Diagnosis.SetFailedPlugin(sts) + fitErr.Diagnosis.AddPluginStatus(sts) return ScheduleResult{nominatingInfo: clearNominatedNode}, assumedPodInfo, framework.NewStatus(sts.Code()).WithError(fitErr) } return ScheduleResult{nominatingInfo: clearNominatedNode}, assumedPodInfo, sts @@ -237,7 +237,7 @@ func (sched *Scheduler) schedulingCycle( NodeToStatusMap: framework.NodeToStatusMap{scheduleResult.SuggestedHost: runPermitStatus}, }, } - fitErr.Diagnosis.SetFailedPlugin(runPermitStatus) + fitErr.Diagnosis.AddPluginStatus(runPermitStatus) return ScheduleResult{nominatingInfo: clearNominatedNode}, assumedPodInfo, framework.NewStatus(runPermitStatus.Code()).WithError(fitErr) } @@ -458,7 +458,7 @@ func (sched *Scheduler) findNodesThatFitPod(ctx context.Context, fwk framework.F msg := s.Message() diagnosis.PreFilterMsg = msg logger.V(5).Info("Status after running PreFilter plugins for pod", "pod", klog.KObj(pod), "status", msg) - diagnosis.SetFailedPlugin(s) + diagnosis.AddPluginStatus(s) return nil, diagnosis, nil } @@ -569,7 +569,7 @@ func (sched *Scheduler) findNodesThatPassFilters( } else { statusesLock.Lock() diagnosis.NodeToStatusMap[nodeInfo.Node().Name] = status - diagnosis.SetFailedPlugin(status) + diagnosis.AddPluginStatus(status) statusesLock.Unlock() } }