diff --git a/pkg/scheduler/framework/preemption/preemption.go b/pkg/scheduler/framework/preemption/preemption.go index 5daf229ebb0..5d393dd16be 100644 --- a/pkg/scheduler/framework/preemption/preemption.go +++ b/pkg/scheduler/framework/preemption/preemption.go @@ -549,6 +549,7 @@ func (ev *Evaluator) DryRunPreemption(ctx context.Context, pod *v1.Pod, potentia nonViolatingCandidates := newCandidateList(numCandidates) violatingCandidates := newCandidateList(numCandidates) parallelCtx, cancel := context.WithCancel(ctx) + defer cancel() nodeStatuses := make(framework.NodeToStatusMap) var statusesLock sync.Mutex var errs []error