atc/worker: exit loop when no worker is chosen
only the limit-active-tasks placemnt strategy should wait for a worker
to become available (for now).
It would be nice if this was true for all strategy and srategy chains
but that requires some refactoring of the worker.pool + worker.client code.
@@ -621,7 +621,10 @@ func (client *client) chooseTaskWorker(
workerSpec,
strategy,
); err != nil {
- if _, ok := err.(NoWorkerFitContainerPlacementStrategyError); !ok {
+ if chosenWorker == nil && !strategy.ModifiesActiveTasks() {
+ // only the limit-active-tasks placement strategy waits for a
+ // worker to become available. All others should error out for
+ // now
return nil, err
}
}
