Skip to content

Commit

Permalink
change wait dependson job log level to error
Browse files Browse the repository at this point in the history
Signed-off-by: Ren <[email protected]>
  • Loading branch information
Along-Ren committed Jun 25, 2023
1 parent 7a9f1ba commit 8d3e5fe
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
17 changes: 8 additions & 9 deletions cmd/controller-manager/app/options/options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,14 @@ func TestAddFlags(t *testing.T) {
QPS: defaultQPS,
Burst: 200,
},
PrintVersion: false,
WorkerThreads: defaultWorkers,
SchedulerNames: []string{"volcano", "volcano2"},
MaxRequeueNum: defaultMaxRequeueNum,
HealthzBindAddress: ":11251",
DetectionPeriodOfDependsOntask: defaultDetectionPeriodOfDependsOntask,
InheritOwnerAnnotations: true,
EnableLeaderElection: true,
LockObjectNamespace: defaultLockObjectNamespace,
PrintVersion: false,
WorkerThreads: defaultWorkers,
SchedulerNames: []string{"volcano", "volcano2"},
MaxRequeueNum: defaultMaxRequeueNum,
HealthzBindAddress: ":11251",
InheritOwnerAnnotations: true,
EnableLeaderElection: true,
LockObjectNamespace: defaultLockObjectNamespace,
}

if !reflect.DeepEqual(expected, s) {
Expand Down
10 changes: 6 additions & 4 deletions pkg/controllers/job/job_controller_actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ func (cc *jobcontroller) syncJob(jobInfo *apis.JobInfo, updateStatus state.Updat
taskIndex := jobhelpers.GetTasklndexUnderJob(taskName, job)
if job.Spec.Tasks[taskIndex].DependsOn != nil {
if !cc.waitDependsOnTaskMeetCondition(taskName, taskIndex, podToCreateEachTask, job) {
klog.V(4).Infof("Job %s/%s depends on task not ready", job.Name, job.Namespace)
klog.Errorf("Job %s/%s depends on task not ready", job.Name, job.Namespace)
// release wait group
for _, pod := range podToCreateEachTask {
go func(pod *v1.Pod) {
Expand Down Expand Up @@ -491,21 +491,23 @@ func (cc *jobcontroller) waitDependsOnTaskMeetCondition(taskName string, taskInd
}
dependsOn := *job.Spec.Tasks[taskIndex].DependsOn
if len(dependsOn.Name) > 1 && dependsOn.Iteration == batch.IterationAny {
// any ready to create task
// any ready to create task, return true
for _, task := range dependsOn.Name {
if cc.isDependsOnPodsReady(task, job) {
return true
}
}
// any not ready to skip create task, return false
return false
} else {
for _, dependsOnTask := range dependsOn.Name {
// any not ready to skip
// any not ready to skip create task, return false
if !cc.isDependsOnPodsReady(dependsOnTask, job) {
return false
}
return true
}
// all ready to create task, return true
return true
}
return true
}
Expand Down

0 comments on commit 8d3e5fe

Please sign in to comment.