Skip to content

Commit

Permalink
fix: update filterable_view to unfilter shared agent jobs (#1211)
Browse files Browse the repository at this point in the history
  • Loading branch information
stoksc authored Aug 31, 2020
1 parent cbb8943 commit c0078f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion master/internal/scheduler/filterable_view.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions master/internal/scheduler/fitting.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}
Expand Down

0 comments on commit c0078f8

Please sign in to comment.