sched: Address review

This commit is contained in:
Łukasz Magiera 2020-04-28 12:31:08 +02:00
parent d57877af31
commit 5f1a27d52b
2 changed files with 7 additions and 2 deletions

View File

@ -293,6 +293,11 @@ func (sh *scheduler) assignWorker(wid WorkerID, w *workerHandle, req *workerRequ
})
sh.workersLk.Unlock()
// This error should always be nil, since nothing is setting it, but just to be safe:
if err != nil {
log.Errorf("error executing worker (withResources): %+v", err)
}
}()
return nil

View File

@ -27,7 +27,7 @@ func (s *taskSelector) Ok(ctx context.Context, task sealtasks.TaskType, whnd *wo
return supported, nil
}
func (s *taskSelector) Cmp(ctx context.Context, task sealtasks.TaskType, a, b *workerHandle) (bool, error) {
func (s *taskSelector) Cmp(ctx context.Context, _ sealtasks.TaskType, a, b *workerHandle) (bool, error) {
atasks, err := a.w.TaskTypes(ctx)
if err != nil {
return false, xerrors.Errorf("getting supported worker task types: %w", err)
@ -40,7 +40,7 @@ func (s *taskSelector) Cmp(ctx context.Context, task sealtasks.TaskType, a, b *w
return len(atasks) < len(btasks), nil // prefer workers which can do less
}
return a.info.Hostname > a.info.Hostname, nil // TODO: Better fallback strategy
return a.info.Hostname > b.info.Hostname, nil // TODO: Better fallback strategy
}
var _ WorkerSelector = &allocSelector{}