Skip to content

Commit

Permalink
Optimize the logic of updating the status of pending pg in the alloca…
Browse files Browse the repository at this point in the history
…te phase

Signed-off-by: wangyang <[email protected]>
  • Loading branch information
wangyang0616 committed Jan 31, 2023
1 parent 51da87a commit 8b37ea2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/scheduler/actions/allocate/allocate.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,16 @@ func (alloc *Action) Execute(ssn *framework.Session) {

for _, job := range ssn.Jobs {
// If not config enqueue action, change Pending pg into Inqueue statue to avoid blocking job scheduling.
if !conf.EnabledActionMap["enqueue"] && job.IsPending() {
job.PodGroup.Status.Phase = scheduling.PodGroupInqueue
} else {
if conf.EnabledActionMap["enqueue"] {
if job.IsPending() {
klog.V(4).Infof("Job <%s/%s> Queue <%s> skip allocate, reason: job status is pending.",
job.Namespace, job.Name, job.Queue)
continue
}
} else if job.IsPending() {
klog.V(4).Infof("Job <%s/%s> Queue <%s> status update from pending to inqueue, reason: no enqueue action is configured.",
job.Namespace, job.Name, job.Queue)
job.PodGroup.Status.Phase = scheduling.PodGroupInqueue
}

if vr := ssn.JobValid(job); vr != nil && !vr.Pass {
Expand Down

0 comments on commit 8b37ea2

Please sign in to comment.