Skip to content

Commit 938b5f8

Browse files
committed
chore(scheduler): add more log info when no preemption candidates is found in preemption
1 parent b30944b commit 938b5f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/scheduler/framework/preemption/preemption.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ import (
4040
apipod "k8s.io/kubernetes/pkg/api/v1/pod"
4141
"k8s.io/kubernetes/pkg/scheduler/framework"
4242
"k8s.io/kubernetes/pkg/scheduler/framework/parallelize"
43-
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/names"
4443
"k8s.io/kubernetes/pkg/scheduler/metrics"
4544
"k8s.io/kubernetes/pkg/scheduler/util"
4645
)
@@ -149,7 +148,7 @@ func NewEvaluator(pluginName string, fh framework.Handle, i Interface, enableAsy
149148
pdbLister := fh.SharedInformerFactory().Policy().V1().PodDisruptionBudgets().Lister()
150149

151150
ev := &Evaluator{
152-
PluginName: names.DefaultPreemption,
151+
PluginName: pluginName,
153152
Handler: fh,
154153
PodLister: podLister,
155154
PdbLister: pdbLister,
@@ -261,6 +260,7 @@ func (ev *Evaluator) Preempt(ctx context.Context, state *framework.CycleState, p
261260

262261
// Return a FitError only when there are no candidates that fit the pod.
263262
if len(candidates) == 0 {
263+
logger.V(2).Info("No preemption candidate is found; preemption is not helpful for scheduling", "pod", klog.KObj(pod))
264264
fitError := &framework.FitError{
265265
Pod: pod,
266266
NumAllNodes: len(allNodes),

0 commit comments

Comments
 (0)