Skip to content

Commit

Permalink
skip completed AWs after MCAD restart
Browse files Browse the repository at this point in the history
  • Loading branch information
asm582 committed Oct 20, 2023
1 parent ccec55c commit 1e602eb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/controller/queuejob/queuejob_controller_ex.go
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ func (qjm *XController) GetAggregatedResources(cqj *arbv1.AppWrapper) *clusterst
}
allocated = allocated.Add(qjv)
}

klog.V(2).Infof("[GetAggregatedResources] Total resources needed to dispatch AW as reported in custompodresources is %v", allocated)
return allocated
}

Expand Down Expand Up @@ -1626,7 +1626,10 @@ func (cc *XController) addQueueJob(obj interface{}) {
if latestAw.Status.State != arbv1.AppWrapperStateActive && latestAw.Status.State != arbv1.AppWrapperStateEnqueued && latestAw.Status.State != arbv1.AppWrapperStateRunningHoldCompletion {
klog.V(2).Infof("[Informer-addQJ] Stopping requeue for AW %s/%s with status %s", latestAw.Namespace, latestAw.Name, latestAw.Status.State)
AwinEtcd, err := cc.arbclients.WorkloadV1beta1().AppWrappers(latestAw.Namespace).Get(context.Background(), latestAw.Name, metav1.GetOptions{})
if AwinEtcd.Status.State == latestAw.Status.State && err != nil {
if apierrors.IsNotFound(err) {
//AW is already completed when MCAD is restarted.
break
} else if AwinEtcd.Status.State == latestAw.Status.State && err != nil {
break // Exit the loop
}
}
Expand Down

0 comments on commit 1e602eb

Please sign in to comment.