14325: Don't count busy workers with state=Unknown as Unallocated.
authorTom Clegg <tclegg@veritasgenetics.com>
Fri, 25 Jan 2019 21:40:59 +0000 (16:40 -0500)
committerTom Clegg <tclegg@veritasgenetics.com>
Fri, 25 Jan 2019 21:40:59 +0000 (16:40 -0500)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg@veritasgenetics.com>

lib/dispatchcloud/worker/pool.go

index 1665a1e43def02e14c7cf915c7f5410131f6c4c8..b2d601d4618c5b82ff5a96a88708dd042537c16b 100644 (file)
@@ -204,7 +204,7 @@ func (wp *Pool) Unallocated() map[arvados.InstanceType]int {
                creating[it] = len(times)
        }
        for _, wkr := range wp.workers {
-               if !(wkr.state == StateIdle || wkr.state == StateBooting || wkr.state == StateUnknown) || wkr.idleBehavior != IdleBehaviorRun {
+               if !(wkr.state == StateIdle || wkr.state == StateBooting || wkr.state == StateUnknown) || wkr.idleBehavior != IdleBehaviorRun || len(wkr.running) > 0 {
                        continue
                }
                it := wkr.instType