1
0
mirror of https://github.com/newnius/YAO-scheduler.git synced 2025-12-13 07:46:43 +00:00

[bugfix] preempt, avoid deadlock

This commit is contained in:
2020-08-13 21:35:38 +08:00
parent 3258e7d784
commit 2c868f459e

View File

@@ -108,10 +108,6 @@ func (scheduler *SchedulerPriority) Start() {
}
}
before := InstanceOfResourcePool().UsingGPU
log.Info("Start preempt ", preempted.Name)
scheduler.Stop(preempted.Name)
/* Remove from history */
idx := -1
for i, job := range scheduler.history {
@@ -125,6 +121,10 @@ func (scheduler *SchedulerPriority) Start() {
}
scheduler.historyMu.Unlock()
before := InstanceOfResourcePool().UsingGPU
log.Info("Start preempt ", preempted.Name)
scheduler.Stop(preempted.Name)
/* add back */
idx = len(scheduler.queue)
for i, job := range scheduler.queue {