diff --git a/master/internal/scheduler/filterable_view.go b/master/internal/scheduler/filterable_view.go index faff7fb2f36..74b1be922b0 100644 --- a/master/internal/scheduler/filterable_view.go +++ b/master/internal/scheduler/filterable_view.go @@ -32,7 +32,10 @@ func schedulableTaskFilter(provisionerSlotsPerInstance int) func(*Task) bool { switch { case task.state != taskPending: return false - case slotsNeeded == 0 || slotsNeeded == 1: + // TODO(DET-4035): This code is duplicated from the fitting functions in the + // scheduler. To determine is a task is schedulable, we would ideally interface + // with the scheduler in some way and not duplicate this logic. + case slotsNeeded <= provisionerSlotsPerInstance: return true case slotsNeeded%provisionerSlotsPerInstance == 0: return true diff --git a/master/internal/scheduler/fitting.go b/master/internal/scheduler/fitting.go index 476077f4de8..282605cfbbd 100644 --- a/master/internal/scheduler/fitting.go +++ b/master/internal/scheduler/fitting.go @@ -66,6 +66,9 @@ func (c candidateList) Swap(i, j int) { func findFits( task *Task, agents map[*actor.Ref]*agentState, fittingMethod SoftConstraint, ) []*fittingState { + // TODO(DET-4035): Some of this code is duplicated in filterable_view.go to prevent + // the provisioner from scaling up for jobs that can never be scheduled in the + // current cluster configuration. if fit := findSharedAgentFit(task, agents, fittingMethod); fit != nil { return []*fittingState{fit} }