This is an automated email from the ASF dual-hosted git repository.
mani pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/yunikorn-core.git
The following commit(s) were added to refs/heads/master by this push:
new eff0a1fc [YUNIKORN-2803] Use FitIn for node check (#945)
eff0a1fc is described below
commit eff0a1fc94f99c442d3000fe42dc3d1700afbaac
Author: Manikandan R <[email protected]>
AuthorDate: Tue Aug 20 11:05:19 2024 +0530
[YUNIKORN-2803] Use FitIn for node check (#945)
Closes: #945
Signed-off-by: Manikandan R <[email protected]>
---
pkg/scheduler/objects/preemption.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pkg/scheduler/objects/preemption.go
b/pkg/scheduler/objects/preemption.go
index 40190fe4..73f24bae 100644
--- a/pkg/scheduler/objects/preemption.go
+++ b/pkg/scheduler/objects/preemption.go
@@ -213,7 +213,6 @@ func (p *Preemptor) checkPreemptionQueueGuarantees() bool {
//nolint:funlen
func (p *Preemptor) calculateVictimsByNode(nodeAvailable *resources.Resource,
potentialVictims []*Allocation) (int, []*Allocation) {
nodeCurrentAvailable := nodeAvailable.Clone()
- allocationsByQueueSnap := p.duplicateQueueSnapshots()
// Initial check: Will allocation fit on node without preemption? This
is possible if preemption was triggered due
// to queue limits and not node resource limits.
@@ -222,6 +221,7 @@ func (p *Preemptor) calculateVictimsByNode(nodeAvailable
*resources.Resource, po
return -1, make([]*Allocation, 0)
}
+ allocationsByQueueSnap := p.duplicateQueueSnapshots()
// get the current queue snapshot
askQueue, ok := allocationsByQueueSnap[p.queuePath]
if !ok {
@@ -326,7 +326,7 @@ func (p *Preemptor) calculateVictimsByNode(nodeAvailable
*resources.Resource, po
// removing task does not violate queue
constraints, adjust queue and node
nodeCurrentAvailable.AddTo(victim.GetAllocatedResource())
// check if ask now fits and we haven't
had this happen before
- if
nodeCurrentAvailable.FitInMaxUndef(p.ask.GetAllocatedResource()) && index < 0 {
+ if
nodeCurrentAvailable.FitIn(p.ask.GetAllocatedResource()) && index < 0 {
index = len(results)
}
// add victim to results
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]