Merge pull request #3225 from filecoin-project/fix/sched-missing-worker

check that worker referenced by task is actually still there.
This commit is contained in:
Łukasz Magiera 2020-08-22 22:16:32 +02:00 committed by GitHub
commit 4311c96a44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -295,7 +295,12 @@ func (sh *scheduler) trySched() {
task.indexHeap = sqi
for wnd, windowRequest := range sh.openWindows {
worker := sh.workers[windowRequest.worker]
worker, ok := sh.workers[windowRequest.worker]
if !ok {
log.Errorf("worker referenced by windowRequest not found (worker: %d)", windowRequest.worker)
// TODO: How to move forward here?
continue
}
// TODO: allow bigger windows
if !windows[wnd].allocated.canHandleRequest(needRes, windowRequest.worker, worker.info.Resources) {