From 7aa1ccf726afa9a4ab68908d9f89c7be190d81a2 Mon Sep 17 00:00:00 2001 From: ocean <3408598@qq.com> Date: Mon, 27 Jul 2020 14:21:29 +0800 Subject: [PATCH] modify workerRequest --- sched.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sched.go b/sched.go index af28b1902..a7a6d3e86 100644 --- a/sched.go +++ b/sched.go @@ -122,6 +122,7 @@ type workerRequest struct { index int // The index of the item in the heap. + indexHeap int ret chan<- workerResponse ctx context.Context } @@ -250,6 +251,7 @@ func (sh *scheduler) trySched() { task := (*sh.schedQueue)[sqi] needRes := ResourceTable[task.taskType][sh.spt] + task.indexHeap = sqi for wnd, windowRequest := range sh.openWindows { worker := sh.workers[windowRequest.worker] @@ -312,7 +314,7 @@ func (sh *scheduler) trySched() { needRes := ResourceTable[task.taskType][sh.spt] selectedWindow := -1 - for _, wnd := range acceptableWindows[sqi+scheduled] { + for _, wnd := range acceptableWindows[task.indexHeap] { wid := sh.openWindows[wnd].worker wr := sh.workers[wid].info.Resources