From 19b7d632481a9375d3fd23335cc62edb21710279 Mon Sep 17 00:00:00 2001 From: qianjiajun <244058785@qq.com> Date: Mon, 13 Nov 2023 21:14:07 +0800 Subject: [PATCH] fix: allocated field in queue status should be calcutated with tasks which status in bound, binding, allocated and running Signed-off-by: qianjiajun <244058785@qq.com> --- pkg/scheduler/framework/session.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/scheduler/framework/session.go b/pkg/scheduler/framework/session.go index 10feb5657e..e52dae710d 100644 --- a/pkg/scheduler/framework/session.go +++ b/pkg/scheduler/framework/session.go @@ -197,8 +197,10 @@ func updateQueueStatus(ssn *Session) { allocatedResources[queueID] = &api.Resource{} } for _, job := range ssn.Jobs { - for _, runningTask := range job.TaskStatusIndex[api.Running] { - allocatedResources[job.Queue].Add(runningTask.Resreq) + for _, task := range job.Tasks { + if api.AllocatedStatus(task.Status) { + allocatedResources[job.Queue].Add(task.Resreq) + } } }