From d257bb2b4a872a159c9e6ce3979ac38da8d2319b Mon Sep 17 00:00:00 2001 From: Vadim Berezniker Date: Tue, 11 Feb 2025 12:55:47 -0800 Subject: [PATCH] Allow setting excess_capacity_threshold to fully disable feature. --- .../priority_task_scheduler/priority_task_scheduler.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/enterprise/server/scheduling/priority_task_scheduler/priority_task_scheduler.go b/enterprise/server/scheduling/priority_task_scheduler/priority_task_scheduler.go index aab0c8cd7ad..1c0ffb73a2a 100644 --- a/enterprise/server/scheduling/priority_task_scheduler/priority_task_scheduler.go +++ b/enterprise/server/scheduling/priority_task_scheduler/priority_task_scheduler.go @@ -661,12 +661,12 @@ func (q *PriorityTaskScheduler) HasExcessCapacity() bool { } // If more than n% of RAM is used; don't request extra work. - if float64(q.ramBytesUsed) > float64(q.ramBytesCapacity)*(*excessCapacityThreshold) { + if float64(q.ramBytesUsed) >= float64(q.ramBytesCapacity)*(*excessCapacityThreshold) { return false } // If more than n% of CPU is used; don't request extra work. - if float64(q.cpuMillisUsed) > float64(q.cpuMillisCapacity)*(*excessCapacityThreshold) { + if float64(q.cpuMillisUsed) >= float64(q.cpuMillisCapacity)*(*excessCapacityThreshold) { return false } return true