Skip to content
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
11 changes: 8 additions & 3 deletions pkg/controller/queuejob/queuejob_controller_ex.go
Original file line number Diff line number Diff line change
Expand Up @@ -954,9 +954,6 @@ func (qjm *XController) getAggregatedAvailableResourcesPriority(unallocatedClust
continue
}

preemptableAWs[value.Status.SystemPriority] = append(preemptableAWs[value.Status.SystemPriority], queueJobKey)
preemptableAWsMap[queueJobKey] = value
klog.V(10).Infof("[getAggAvaiResPri] %s: Added %s to candidate preemptable job with priority %f.", time.Now().String(), value.Name, value.Status.SystemPriority)
}

err := qjm.qjobResControls[arbv1.ResourceTypePod].UpdateQueueJobStatus(value)
Expand All @@ -968,6 +965,8 @@ func (qjm *XController) getAggregatedAvailableResourcesPriority(unallocatedClust
klog.V(10).Infof("[getAggAvaiResPri] total resources consumed by Appwrapper %v when lower priority compared to target are %v", value.Name, totalResource)
preemptable = preemptable.Add(totalResource)
klog.V(6).Infof("[getAggAvaiResPri] %s proirity %v is lower target priority %v reclaiming total preemptable resources %v", value.Name, value.Status.SystemPriority, targetpr, totalResource)
queueJobKey, _ := GetQueueJobKey(value)
addPreemptableAWs(preemptableAWs, value, queueJobKey, preemptableAWsMap)
continue
} else if qjm.isDispatcher {
// Dispatcher job does not currently track pod states. This is
Expand Down Expand Up @@ -1016,6 +1015,12 @@ func (qjm *XController) getAggregatedAvailableResourcesPriority(unallocatedClust
return r, proposedPremptions
}

func addPreemptableAWs(preemptableAWs map[float64][]string, value *arbv1.AppWrapper, queueJobKey string, preemptableAWsMap map[string]*arbv1.AppWrapper) {
preemptableAWs[value.Status.SystemPriority] = append(preemptableAWs[value.Status.SystemPriority], queueJobKey)
preemptableAWsMap[queueJobKey] = value
klog.V(10).Infof("[getAggAvaiResPri] %s: Added %s to candidate preemptable job with priority %f.", time.Now().String(), value.Name, value.Status.SystemPriority)
}

func (qjm *XController) chooseAgent(qj *arbv1.AppWrapper) string {

qjAggrResources := qjm.GetAggregatedResources(qj)
Expand Down