Skip to content

Commit

Permalink
scheduler: fix a bug where the job NodesFitErrors field is not update…
Browse files Browse the repository at this point in the history
…d when ssn.Allocate failed

Signed-off-by: SataQiu <[email protected]>
  • Loading branch information
SataQiu committed Feb 14, 2025
1 parent 6b5bf18 commit f11afe2
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pkg/scheduler/actions/backfill/backfill.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ func (backfill *Action) Execute(ssn *framework.Session) {
for _, task := range pendingTasks {
job := ssn.Jobs[task.Job]
ph := util.NewPredicateHelper()
allocated := false
fe := api.NewFitErrors()

if err := ssn.PrePredicateFn(task); err != nil {
Expand Down Expand Up @@ -93,16 +92,13 @@ func (backfill *Action) Execute(ssn *framework.Session) {
if err := ssn.Allocate(task, node); err != nil {
klog.Errorf("Failed to bind Task %v on %v in Session %v", task.UID, node.Name, ssn.UID)
fe.SetNodeError(node.Name, err)
job.NodesFitErrors[task.UID] = fe
continue
}

metrics.UpdateE2eSchedulingDurationByJob(job.Name, string(job.Queue), job.Namespace, metrics.Duration(job.CreationTimestamp.Time))
metrics.UpdateE2eSchedulingLastTimeByJob(job.Name, string(job.Queue), job.Namespace, time.Now())
allocated = true

if !allocated {
job.NodesFitErrors[task.UID] = fe
}
// TODO (k82cn): backfill for other case.
}
}
Expand Down

0 comments on commit f11afe2

Please sign in to comment.