From dd237159424ca83ed7335fbec19a3057bc9c7adb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 29 Apr 2020 16:56:20 +0200 Subject: [PATCH] sched: add missing check for non-multicore thread availability --- sched.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sched.go b/sched.go index ad3c948dd..99ff6ded2 100644 --- a/sched.go +++ b/sched.go @@ -373,6 +373,11 @@ func canHandleRequest(needRes Resources, spt abi.RegisteredProof, wid WorkerID, log.Debugf("sched: not scheduling on worker %d; multicore process needs %d threads, %d in use, target %d", wid, res.CPUs, active.cpuUse, res.CPUs) return false } + } else { + if active.cpuUse + uint64(needRes.Threads) > res.CPUs { + log.Debugf("sched: not scheduling on worker %d; not enough threads, need %d, %d in use, target %d", wid, needRes.Threads, active.cpuUse, res.CPUs) + return false + } } if len(res.GPUs) > 0 && needRes.CanGPU {