Skip to content

Commit

Permalink
Eliminate queue with no suitable jobs from scheduling. (#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
jankaspar committed Feb 28, 2020
1 parent eb09919 commit f1ff169
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions internal/armada/server/lease.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,14 @@ func (q *AggregatedQueueServer) distributeRemainder(lc *leaseContext, limit int)
}
if len(leased) > 0 {
emptySteps = 0
jobs = append(jobs, leased...)
scheduledShare := scheduling.ResourcesFloatAsUsage(lc.resourceScarcity, remainder) - scheduling.ResourcesFloatAsUsage(lc.resourceScarcity, remaining)
shares[queue] = math.Max(0, shares[queue]-scheduledShare)
remainder = remaining
} else {
// if there are no suitable jobs to lease eliminate queue from the scheduling
shares[queue] = 0
}
jobs = append(jobs, leased...)
scheduledShare := scheduling.ResourcesFloatAsUsage(lc.resourceScarcity, remainder) - scheduling.ResourcesFloatAsUsage(lc.resourceScarcity, remaining)
shares[queue] = math.Max(0, shares[queue]-scheduledShare)
remainder = remaining

limit -= len(leased)
if limit <= 0 || closeToDeadline(lc.ctx) {
Expand Down

0 comments on commit f1ff169

Please sign in to comment.