Skip to content

Commit 15ebb45

Browse files
committed
skip unavailable jobs during the close session step #4011
Signed-off-by: 王凯 <wangkai05@bilibili.com>
1 parent 6b5bf18 commit 15ebb45

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/scheduler/plugins/gang/gang.go

+4
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ func (gp *gangPlugin) OnSessionClose(ssn *framework.Session) {
163163
var unreadyTaskCount int32
164164
var unScheduleJobCount int
165165
for _, job := range ssn.Jobs {
166+
// skip the jobs that have no tasks.
167+
if len(job.Tasks) == 0 {
168+
continue
169+
}
166170
if !job.IsReady() {
167171
schedulableTaskNum := func() (num int32) {
168172
for _, task := range job.TaskStatusIndex[api.Pending] {

0 commit comments

Comments
 (0)