16739: Fix using two different throttles.
authorTom Clegg <tom@tomclegg.ca>
Mon, 31 Aug 2020 19:34:22 +0000 (15:34 -0400)
committerTom Clegg <tom@tomclegg.ca>
Mon, 31 Aug 2020 19:34:22 +0000 (15:34 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@tomclegg.ca>

lib/dispatchcloud/worker/pool.go

index 2d958d8378314b17be8350915067313fb6521160..ec6a049e640e7e1d619251e21af07f418aa28713 100644 (file)
@@ -170,9 +170,6 @@ type Pool struct {
        runnerMD5    [md5.Size]byte
        runnerCmd    string
 
-       throttleCreate    throttle
-       throttleInstances throttle
-
        mContainersRunning prometheus.Gauge
        mInstances         *prometheus.GaugeVec
        mInstancesPrice    *prometheus.GaugeVec
@@ -307,7 +304,7 @@ func (wp *Pool) Create(it arvados.InstanceType) bool {
        }
        wp.mtx.Lock()
        defer wp.mtx.Unlock()
-       if time.Now().Before(wp.atQuotaUntil) || wp.throttleCreate.Error() != nil {
+       if time.Now().Before(wp.atQuotaUntil) || wp.instanceSet.throttleCreate.Error() != nil {
                return false
        }
        // The maxConcurrentNodeCreateOps knob throttles the number of node create