Skip to content

Commit

Permalink
Merge pull request #3458 from LivingCcj/master
Browse files Browse the repository at this point in the history
ignore PredicateFn err info for preempt & reclaim scheduler plugin
  • Loading branch information
volcano-sh-bot authored May 11, 2024
2 parents 703745a + 1b889d2 commit 7605027
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
8 changes: 3 additions & 5 deletions pkg/scheduler/actions/preempt/preempt.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,11 @@ func preempt(
}

predicateFn := func(task *api.TaskInfo, node *api.NodeInfo) ([]*api.Status, error) {
// Allows scheduling to nodes that are in Success or Unschedulable state after filtering by predicate.
var statusSets util.StatusSets
statusSets, err := ssn.PredicateFn(task, node)
if err != nil {
return nil, api.NewFitError(task, node, err.Error())
}
statusSets, _ = ssn.PredicateFn(task, node)

// When filtering candidate nodes, need to consider the node statusSets instead of the err information.
// refer to kube-scheduler preemption code: https://github.com/kubernetes/kubernetes/blob/9d87fa215d9e8020abdc17132d1252536cd752d2/pkg/scheduler/framework/preemption/preemption.go#L422
if statusSets.ContainsUnschedulableAndUnresolvable() || statusSets.ContainsErrorSkipOrWait() {
return nil, api.NewFitError(task, node, statusSets.Message())
}
Expand Down
10 changes: 3 additions & 7 deletions pkg/scheduler/actions/reclaim/reclaim.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,10 @@ func (ra *Action) Execute(ssn *framework.Session) {
assigned := false
for _, n := range ssn.Nodes {
var statusSets util.StatusSets
statusSets, err := ssn.PredicateFn(task, n)
if err != nil {
klog.V(5).Infof("reclaim predicates failed for task <%s/%s> on node <%s>: %v",
task.Namespace, task.Name, n.Name, err)
continue
}
statusSets, _ = ssn.PredicateFn(task, n)

// Allows scheduling to nodes that are in Success or Unschedulable state after filtering by predicate.
// When filtering candidate nodes, need to consider the node statusSets instead of the err information.
// refer to kube-scheduler preemption code: https://github.com/kubernetes/kubernetes/blob/9d87fa215d9e8020abdc17132d1252536cd752d2/pkg/scheduler/framework/preemption/preemption.go#L422
if statusSets.ContainsUnschedulableAndUnresolvable() || statusSets.ContainsErrorSkipOrWait() {
klog.V(5).Infof("predicates failed in reclaim for task <%s/%s> on node <%s>, reason is %s.",
task.Namespace, task.Name, n.Name, statusSets.Message())
Expand Down
4 changes: 2 additions & 2 deletions pkg/scheduler/conf/scheduler_conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ type PluginOption struct {
EnablePreemptive *bool `yaml:"enablePreemptive"`
// EnabledQueueOrder defines whether queueOrderFn is enabled
EnabledQueueOrder *bool `yaml:"enableQueueOrder"`
// EnabledPredicate defines whether predicateFn is enabled
EnabledClusterOrder *bool `yaml:"EnabledClusterOrder"`
// EnableClusterOrder defines whether clusterOrderFn is enabled
EnabledClusterOrder *bool `yaml:"EnabledClusterOrder"`
// EnabledPredicate defines whether predicateFn is enabled
EnabledPredicate *bool `yaml:"enablePredicate"`
// EnabledBestNode defines whether bestNodeFn is enabled
EnabledBestNode *bool `yaml:"enableBestNode"`
Expand Down

0 comments on commit 7605027

Please sign in to comment.