Skip to content

Commit

Permalink
scheduler: improve coscheduling's PostFilter if not collect enough (#…
Browse files Browse the repository at this point in the history
…1948)

Signed-off-by: Joseph <joseph.t.lee@outlook.com>
  • Loading branch information
eahydra authored Mar 13, 2024
1 parent 3bf7ba8 commit 61c0013
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/scheduler/plugins/coscheduling/core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,16 +369,21 @@ func (pgMgr *PodGroupManager) rejectGangGroupById(handle framework.Handle, plugi
gangGroup := gang.getGangGroup()
gangSet := sets.NewString(gangGroup...)

rejectedPodCount := 0
if handle != nil {
handle.IterateOverWaitingPods(func(waitingPod framework.WaitingPod) {
waitingGangId := util.GetId(waitingPod.GetPod().Namespace, util.GetGangNameByPod(waitingPod.GetPod()))
if gangSet.Has(waitingGangId) {
klog.V(1).InfoS("GangGroup gets rejected due to member Gang is unschedulable",
"gang", gangId, "waitingGang", waitingGangId, "waitingPod", klog.KObj(waitingPod.GetPod()))
waitingPod.Reject(pluginName, message)
rejectedPodCount++
}
})
}
if rejectedPodCount == 0 {
return
}
for gang := range gangSet {
gangIns := pgMgr.cache.getGangFromCacheByGangId(gang, false)
if gangIns != nil {
Expand Down

0 comments on commit 61c0013

Please sign in to comment.