Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor cleanup in lease.go #2603

Merged
merged 7 commits into from
Jun 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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