Skip to content

Commit 6c18598

Browse files
asm582openshift-merge-robot
authored andcommitted
fix build
1 parent 88cdd96 commit 6c18598

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

pkg/controller/clusterstate/cache/cache.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import (
3434
"context"
3535
"fmt"
3636
"sync"
37-
"time"
3837

3938
"github.com/golang/protobuf/proto"
4039
dto "github.com/prometheus/client_model/go"
@@ -102,7 +101,7 @@ func (sc *ClusterStateCache) Run(stopCh <-chan struct{}) {
102101
go sc.nodeInformer.Informer().Run(stopCh)
103102

104103
// Update cache
105-
go wait.Until(sc.updateCache, 1*time.Second, stopCh)
104+
go wait.Until(sc.updateCache, 0, stopCh)
106105

107106
}
108107

pkg/controller/queuejob/queuejob_controller_ex.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1111,8 +1111,21 @@ func (qjm *XController) ScheduleNext(qj *arbv1.AppWrapper) {
11111111
if qjm.serverOption.DynamicPriority {
11121112
priorityindex = -math.MaxFloat64
11131113
}
1114+
//cache.go updatestate method fails resulting in empty resource object
1115+
//cache upate failure costly, as it will put current AW in backoff queue plus take another dispatch cycle
1116+
//In worst case the cache update could fail for subsequent dispatche cycles causing test cases to fail or AW never getting dispatched
1117+
//To avoid non-determinism below code is workaround. this should be issue should be fixed: https://github.com/project-codeflare/multi-cluster-app-dispatcher/issues/550
1118+
var unallocatedResources = clusterstateapi.EmptyResource()
1119+
unallocatedResources = qjm.cache.GetUnallocatedResources()
1120+
for unallocatedResources.IsEmpty() {
1121+
unallocatedResources.Add(qjm.cache.GetUnallocatedResources())
1122+
if !unallocatedResources.IsEmpty() {
1123+
break
1124+
}
1125+
}
1126+
11141127
resources, proposedPreemptions := qjm.getAggregatedAvailableResourcesPriority(
1115-
qjm.cache.GetUnallocatedResources(), priorityindex, qj, "")
1128+
unallocatedResources, priorityindex, qj, "")
11161129
klog.Infof("[ScheduleNext] [Agent Mode] Appwrapper '%s/%s' with resources %v to be scheduled on aggregated idle resources %v", qj.Namespace, qj.Name, aggqj, resources)
11171130

11181131
// Assume preemption will remove low priroity AWs in the system, optimistically dispatch such AWs

test/e2e/util.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1918,16 +1918,12 @@ func createGenericNamespaceAW(context *context, name string) *arbv1.AppWrapper {
19181918
"app": "aw-generic-namespace-0"
19191919
}
19201920
}} `)
1921-
var schedSpecMin int = 0
19221921

19231922
aw := &arbv1.AppWrapper{
19241923
ObjectMeta: metav1.ObjectMeta{
19251924
Name: name,
19261925
},
19271926
Spec: arbv1.AppWrapperSpec{
1928-
SchedSpec: arbv1.SchedulingSpecTemplate{
1929-
MinAvailable: schedSpecMin,
1930-
},
19311927
AggrResources: arbv1.AppWrapperResourceList{
19321928
GenericItems: []arbv1.AppWrapperGenericResource{
19331929
{

0 commit comments

Comments
 (0)