Merge pull request #111773 from amewayne/fix_mem_leak_in_preemption

fix a memory leakage problem when calling DryRunPreemption
This commit is contained in:
Kubernetes Prow Robot 2022-08-11 08:36:58 -07:00 committed by GitHub
commit 7b1b801295
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -573,6 +573,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