Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions internal/scheduler/scheduling/preempting_queue_scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -483,14 +483,7 @@ func (sch *PreemptingQueueScheduler) evictionAssertions(evictorResult *EvictorRe
)
}
}
evictedJctxsByGangId := make(map[string][]*schedulercontext.JobSchedulingContext)
for jobId, jctx := range evictorResult.EvictedJctxsByJobId {
if jctx.Job.IsInGang() {
if _, present := evictedJctxsByGangId[jctx.Job.GetGangInfo().Id()]; !present {
evictedJctxsByGangId[jctx.Job.GetGangInfo().Id()] = []*schedulercontext.JobSchedulingContext{}
}
evictedJctxsByGangId[jctx.Job.GetGangInfo().Id()] = append(evictedJctxsByGangId[jctx.Job.GetGangInfo().Id()], jctx)
}
if !jctx.IsEvicted {
return errors.New("evicted job %s is not marked as such")
}
Expand All @@ -502,29 +495,6 @@ func (sch *PreemptingQueueScheduler) evictionAssertions(evictorResult *EvictorRe
return errors.Errorf("evicted job %s is missing target node id selector: job nodeSelector %v", jobId, jctx.AdditionalNodeSelectors)
}
}
seenGangs := map[string]int{}
for gangId, evictedJctxs := range evictedJctxsByGangId {
if len(evictedJctxs) < 1 {
continue
}
representativeJctx := evictedJctxs[0]
if _, exists := seenGangs[gangId]; !exists {
activeGangJobs, err := sch.getActiveGangJobs(representativeJctx.Job.Queue(), representativeJctx.Job.GetGangInfo().Id())
if err != nil {
return err
}
seenGangs[gangId] = len(activeGangJobs)
}

activeGangJobCount := seenGangs[gangId]

if len(evictedJctxs) != activeGangJobCount {
return errors.Errorf(
"gang %s was partially evicted: %d out of %d jobs evicted",
gangId, len(evictedJctxs), activeGangJobCount,
)
}
}
return nil
}

Expand Down