20457: Exercise quota handling in dispatcher chaos test.
[arvados.git] / lib / dispatchcloud / worker / pool.go
index f79bad98fc16397e85f1469ef8d8013214aad8f9..15b0dbcde57d4d3af93233b11bcc663973015a58 100644 (file)
@@ -1053,6 +1053,10 @@ func (wp *Pool) sync(threshold time.Time, instances []cloud.Instance) {
        }
 
        if wp.atQuotaUntilFewerInstances > len(wp.workers)+len(wp.creating) {
+               // After syncing, there are fewer instances (including
+               // pending creates) than there were last time we saw a
+               // quota error.  This might mean it's now possible to
+               // create new instances.  Reset our "at quota" state.
                wp.atQuotaUntilFewerInstances = 0
        }