Skip to content

Commit

Permalink
resourcemanager: avoid to schedule when no task is in the pool
Browse files Browse the repository at this point in the history
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
  • Loading branch information
hawkingrei committed Feb 6, 2023
1 parent 1e54ee4 commit 5b80f25
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions resourcemanager/schedule.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ func (r *ResourceManager) schedule() {
}

func (r *ResourceManager) schedulePool(pool *util.PoolContainer) scheduler.Command {
for _, sch := range r.scheduler {
cmd := sch.Tune(pool.Component, pool.Pool)
switch cmd {
case scheduler.Hold:
continue
default:
return cmd
if pool.Pool.Running() != 0 {
for _, sch := range r.scheduler {
cmd := sch.Tune(pool.Component, pool.Pool)
switch cmd {
case scheduler.Hold:
continue
default:
return cmd
}
}
}
return scheduler.Hold
Expand Down

0 comments on commit 5b80f25

Please sign in to comment.