Skip to content

Commit

Permalink
Minor cleanup in lease.go (#2603)
Browse files Browse the repository at this point in the history
* Fix per-pc resource limits

* Lint

* Cleanup

* Fix tests

* Minor cleanup in lease.go
  • Loading branch information
severinson authored Jun 23, 2023
1 parent 807569f commit c6466da
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions internal/armada/server/lease.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,14 +295,6 @@ func (q *AggregatedQueueServer) getJobs(ctx context.Context, req *api.StreamingL
priorityFactorByQueue[queue.Name] = float64(queue.PriorityFactor)
apiQueues[i] = &api.Queue{Name: queue.Name}
}
activeQueues, err := q.jobRepository.FilterActiveQueues(apiQueues)
if err != nil {
return nil, err
}
priorityFactorByActiveQueue := make(map[string]float64, len(activeQueues))
for _, queue := range activeQueues {
priorityFactorByActiveQueue[queue.Name] = priorityFactorByQueue[queue.Name]
}

// Nodes to be considered by the scheduler.
lastSeen := q.clock.Now()
Expand Down Expand Up @@ -336,7 +328,7 @@ func (q *AggregatedQueueServer) getJobs(ctx context.Context, req *api.StreamingL
if err != nil {
return nil, err
}
receivedJobIds := make(map[string]bool)
receivedJobIds := make(map[string]bool, len(jobs))
for _, job := range jobs {
receivedJobIds[job.Id] = true
}
Expand Down Expand Up @@ -455,7 +447,7 @@ func (q *AggregatedQueueServer) getJobs(ctx context.Context, req *api.StreamingL
Pool: req.Pool,
Nodes: nodes,
MinimumJobSize: schedulerobjects.ResourceList{Resources: req.MinimumJobSize},
LastUpdateTime: time.Now(),
LastUpdateTime: q.clock.Now(),
}); err != nil {
// This is not fatal; we can still schedule if it doesn't happen.
log.WithError(err).Warnf("could not store executor details for cluster %s", req.ClusterId)
Expand Down

0 comments on commit c6466da

Please sign in to comment.