From 81329f0cc5199b3239892169de2c71fab634490d Mon Sep 17 00:00:00 2001 From: Klaus Ma Date: Sun, 31 May 2020 10:21:40 +0800 Subject: [PATCH] Skipped task if no candidate nodes. Signed-off-by: Klaus Ma --- pkg/scheduler/actions/allocate/allocate.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/scheduler/actions/allocate/allocate.go b/pkg/scheduler/actions/allocate/allocate.go index d6e0432044..37b122bbfa 100644 --- a/pkg/scheduler/actions/allocate/allocate.go +++ b/pkg/scheduler/actions/allocate/allocate.go @@ -199,6 +199,11 @@ func (alloc *Action) Execute(ssn *framework.Session) { } } + // If not candidate nodes for this task, skip it. + if len(candidateNodes) == 0 { + continue + } + nodeScores := util.PrioritizeNodes(task, candidateNodes, ssn.BatchNodeOrderFn, ssn.NodeOrderMapFn, ssn.NodeOrderReduceFn) node := ssn.BestNodeFn(task, nodeScores)