Skip to content

Commit 7356aa2

Browse files
asm582openshift-merge-robot
authored andcommitted
update pod count beofre preemption
1 parent ed9bc20 commit 7356aa2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: pkg/controller/queuejob/queuejob_controller_ex.go

+5
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,11 @@ func (qjm *XController) PreemptQueueJobs() {
364364
klog.Warningf("[PreemptQueueJobs] failed in retrieving a fresh copy of the app wrapper '%s/%s', err=%v. Will try to preempt on the next run.", aw.Namespace, aw.Name, err)
365365
continue
366366
}
367+
//we need to update AW before analyzing it as a candidate for preemption
368+
updateErr := qjm.UpdateQueueJobStatus(newjob)
369+
if updateErr != nil {
370+
klog.Warningf("[PreemptQueueJobs] update of pod count to AW %v failed hence skipping preemption", newjob.Name)
371+
}
367372
newjob.Status.CanRun = false
368373
newjob.Status.FilterIgnore = true // update QueueJobState only
369374
cleanAppWrapper := false

0 commit comments

Comments
 (0)