From c6466da22cc7ed14b78149ea3e90a56afa1f7be1 Mon Sep 17 00:00:00 2001 From: Albin Severinson Date: Fri, 23 Jun 2023 11:26:16 +0100 Subject: [PATCH] Minor cleanup in lease.go (#2603) * Fix per-pc resource limits * Lint * Cleanup * Fix tests * Minor cleanup in lease.go --- internal/armada/server/lease.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/internal/armada/server/lease.go b/internal/armada/server/lease.go index 572cc890bc7..486a8bec099 100644 --- a/internal/armada/server/lease.go +++ b/internal/armada/server/lease.go @@ -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() @@ -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 } @@ -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)