You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
newjob, err:=qjm.getAppWrapper(aw.Namespace, aw.Name, "[PreemptQueueJobs] get fresh app wrapper")
363
364
iferr!=nil {
364
365
klog.Warningf("[PreemptQueueJobs] failed in retrieving a fresh copy of the app wrapper '%s/%s', err=%v. Will try to preempt on the next run.", aw.Namespace, aw.Name, err)
365
-
continue
366
+
return
366
367
}
367
368
//we need to update AW before analyzing it as a candidate for preemption
klog.V(3).Infof("AppWrapper '%s/%s' is eligible for preemption Running: %d - minAvailable: %d , Succeeded: %d !!!", value.Namespace, value.Name, value.Status.Running, replicas, value.Status.Succeeded)
587
-
qjobs=append(qjobs, value)
588
-
}
589
-
} else {
590
-
// Preempt when schedulingSpec stanza is not set but pods fails scheduling.
591
-
// ignore co-scheduler pods
592
-
iflen(value.Status.PendingPodConditions) >0 {
593
-
klog.V(3).Infof("AppWrapper '%s/%s' is eligible for preemption Running: %d , Succeeded: %d due to failed scheduling !!!", value.Namespace, value.Status.Running, value.Status.Succeeded)
594
-
qjobs=append(qjobs, value)
595
-
}
570
+
ifreplicas>0 {
571
+
klog.V(3).Infof("AppWrapper '%s/%s' is eligible for preemption Running: %d - minAvailable: %d , Succeeded: %d !!!", value.Namespace, value.Name, value.Status.Running, replicas, value.Status.Succeeded)
572
+
returnvalue
573
+
}
574
+
} else {
575
+
// Preempt when schedulingSpec stanza is not set but pods fails scheduling.
576
+
// ignore co-scheduler pods
577
+
iflen(value.Status.PendingPodConditions) >0 {
578
+
klog.V(3).Infof("AppWrapper '%s/%s' is eligible for preemption Running: %d , Succeeded: %d due to failed scheduling !!!", value.Namespace, value.Status.Running, value.Status.Succeeded)
klog.V(2).Infof("[Informer-addQJ] Stopping requeue for AW %s with status %s", latestAw.(*arbv1.AppWrapper).Name, latestAw.(*arbv1.AppWrapper).Status.State)
1666
-
break//Exit the loop
1667
-
}
1668
-
iferr==nil&&exists {
1639
+
iferr!=nil&&!exists {
1640
+
klog.Warningf("[Informer-addQJ] Recent copy of AW %s not found in cache", qj.Name)
klog.V(2).Infof("[Informer-addQJ] Stopping requeue for AW %s with status %s", latestAw.(*arbv1.AppWrapper).Name, latestAw.(*arbv1.AppWrapper).Status.State)
1644
+
break//Exit the loop
1645
+
}
1669
1646
// Enqueue the latest copy of the AW.
1670
1647
if (qj.Status.State!=arbv1.AppWrapperStateCompleted&&qj.Status.State!=arbv1.AppWrapperStateFailed) &&hasCompletionStatus {
1671
1648
cc.UpdateQueueJobs(latestAw.(*arbv1.AppWrapper))
1672
-
klog.V(2).Infof("[Informer-addQJ] Finished requeing AW to determine completion status")
1649
+
klog.V(2).Infof("[Informer-addQJ] requeing AW to determine completion status for AW", qj.Name)
1650
+
}
1651
+
1652
+
}
1653
+
1654
+
}
1655
+
}()
1656
+
}
1657
+
1658
+
ifqj.Spec.SchedSpec.MinAvailable>0 {
1659
+
requeueInterval:=60*time.Second
1660
+
key, err:=cache.MetaNamespaceKeyFunc(qj)
1661
+
iferr!=nil {
1662
+
klog.Errorf("[Informer-addQJ] Error getting AW %s from cache cannot preempt AW", qj.Name)
klog.V(2).Infof("[Informer-addQJ] Stopping requeue for AW %s with status %s", latestAw.(*arbv1.AppWrapper).Name, latestAw.(*arbv1.AppWrapper).Status.State)
1674
+
break//Exit the loop
1675
+
}
1676
+
// Enqueue the latest copy of the AW.
1677
+
if (qj.Status.State!=arbv1.AppWrapperStateCompleted&&qj.Status.State!=arbv1.AppWrapperStateFailed) && (qj.Spec.SchedSpec.MinAvailable>0) {
1678
+
cc.PreemptQueueJobs(latestAw.(*arbv1.AppWrapper))
1679
+
klog.V(2).Infof("[Informer-addQJ] requeing AW to check minScheduling spec for AW", qj.Name)
0 commit comments