Skip to content

Commit

Permalink
use goroutine pool deal sc.taskUnschedulable
Browse files Browse the repository at this point in the history
Signed-off-by: 张建宇 <[email protected]>
  • Loading branch information
张建宇 committed Jan 7, 2025
1 parent 69641a5 commit a02189f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/scheduler/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ import (
const (
// default interval for sync data from metrics server, the value is 30s
defaultMetricsInternal = 30 * time.Second

taskUpdaterWorker = 16
)

// defaultIgnoredProvisioners contains provisioners that will be ignored during pod pvc request computation and preemption.
Expand Down Expand Up @@ -1487,13 +1489,12 @@ func (sc *SchedulerCache) RecordJobStatusEvent(job *schedulingapi.JobInfo, updat
// Update podCondition for tasks Allocated and Pending before job discarded
for _, status := range []schedulingapi.TaskStatus{schedulingapi.Allocated, schedulingapi.Pending, schedulingapi.Pipelined} {
statusTasks := job.TaskStatusIndex[status]
workerNum := 16
taskInfos := make([]*schedulingapi.TaskInfo, 0, len(statusTasks))
for _, task := range statusTasks {
taskInfos = append(taskInfos, task)
}

workqueue.ParallelizeUntil(context.TODO(), workerNum, len(taskInfos), func(index int) {
workqueue.ParallelizeUntil(context.TODO(), taskUpdaterWorker, len(taskInfos), func(index int) {
taskInfo := taskInfos[index]

// The pod of a scheduling gated task is given
Expand Down

0 comments on commit a02189f

Please sign in to comment.