15340: Skip metrics update when running tests with no registry.
authorTom Clegg <tclegg@veritasgenetics.com>
Fri, 14 Jun 2019 20:52:36 +0000 (16:52 -0400)
committerTom Clegg <tclegg@veritasgenetics.com>
Fri, 14 Jun 2019 20:52:36 +0000 (16:52 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg@veritasgenetics.com>

lib/dispatchcloud/worker/pool.go

index 8616d6e9a5d9de42d3b36c966f44362d2b632fbd..201e8aad276eb5f8ca353e3ff8c41fc9dee00f2a 100644 (file)
@@ -789,7 +789,9 @@ func (wp *Pool) sync(threshold time.Time, instances []cloud.Instance) {
                        "WorkerState": wkr.state,
                })
                logger.Info("instance disappeared in cloud")
-               wp.mDisappearances.WithLabelValues(stateString[wkr.state]).Inc()
+               if wp.mDisappearances != nil {
+                       wp.mDisappearances.WithLabelValues(stateString[wkr.state]).Inc()
+               }
                delete(wp.workers, id)
                go wkr.Close()
                notify = true