From 7dc793353104c7f71cfab0f8abbe88906cc6f627 Mon Sep 17 00:00:00 2001 From: robertdavidsmith <34475852+robertdavidsmith@users.noreply.github.com> Date: Thu, 13 Jun 2024 14:56:46 +0100 Subject: [PATCH] Scheduler: fix potential int64 overflow on large clusters (#3671) --- internal/scheduler/fairness/fairness.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/scheduler/fairness/fairness.go b/internal/scheduler/fairness/fairness.go index 56c5497bf64..991a14fbe09 100644 --- a/internal/scheduler/fairness/fairness.go +++ b/internal/scheduler/fairness/fairness.go @@ -55,7 +55,7 @@ func (f *DominantResourceFairness) CostFromAllocationAndWeight(allocation schedu continue } q := allocation.Get(t) - tcost := float64(q.MilliValue()) / float64(capacity.MilliValue()) + tcost := q.AsApproximateFloat64() / capacity.AsApproximateFloat64() if tcost > cost { cost = tcost }