diff --git a/pkg/scheduler/objects/sorters.go b/pkg/scheduler/objects/sorters.go index e677a712e..24f9dec75 100644 --- a/pkg/scheduler/objects/sorters.go +++ b/pkg/scheduler/objects/sorters.go @@ -100,17 +100,15 @@ func sortQueuesByFairnessAndPriority(queues []*Queue, fairMaxResources []*resour func sortApplications(apps map[string]*Application, sortType policies.SortPolicy, considerPriority bool, globalResource *resources.Resource) []*Application { sortingStart := time.Now() - var sortedApps []*Application + sortedApps := filterOnPendingResources(apps) switch sortType { case policies.FairSortPolicy: - sortedApps = filterOnPendingResources(apps) if considerPriority { sortApplicationsByPriorityAndFairness(sortedApps, globalResource) } else { sortApplicationsByFairnessAndPriority(sortedApps, globalResource) } case policies.FifoSortPolicy: - sortedApps = filterOnPendingResources(apps) if considerPriority { sortApplicationsByPriorityAndSubmissionTime(sortedApps) } else {