14360: Note race in docs, fix flaky test.
[arvados.git] / lib / dispatchcloud / worker / pool.go
index 4e331256f9123d37f0c81bda8edaaa096fc82969..45e9da37adc7b544b8eb4e3e001f4554bbd3e3a9 100644 (file)
@@ -185,6 +185,11 @@ func (wp *Pool) Unsubscribe(ch <-chan struct{}) {
 
 // Unallocated returns the number of unallocated (creating + booting +
 // idle + unknown) workers for each instance type.
+//
+// The returned counts should be interpreted as upper bounds, rather
+// than exact counts: they are sometimes artificially high when a
+// newly created instance appears in the driver's Instances() list
+// before the Create() call returns.
 func (wp *Pool) Unallocated() map[arvados.InstanceType]int {
        wp.setupOnce.Do(wp.setup)
        wp.mtx.RLock()