Skip to content

Commit

Permalink
Merge pull request #1138 from merryzhou/terminate-when-stop-retry
Browse files Browse the repository at this point in the history
fix: terminate job and release resources when drop job out of queue
  • Loading branch information
volcano-sh-bot authored Dec 30, 2020
2 parents 7d21a54 + b5835b2 commit 57923d4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/controllers/job/job_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,10 @@ func (cc *jobcontroller) processNextReq(count uint32) bool {
}
cc.recordJobEvent(jobInfo.Job.Namespace, jobInfo.Job.Name, batchv1alpha1.ExecuteAction, fmt.Sprintf(
"Job failed on action %s for retry limit reached", action))
klog.Warningf("Terminating Job <%s/%s> and releasing resources", jobInfo.Job.Namespace, jobInfo.Job.Name)
if err = st.Execute(busv1alpha1.TerminateJobAction); err != nil {
klog.Errorf("Failed to terminate Job<%s/%s>: %v", jobInfo.Job.Namespace, jobInfo.Job.Name, err)
}
klog.Warningf("Dropping job<%s/%s> out of the queue: %v because max retries has reached", jobInfo.Job.Namespace, jobInfo.Job.Name, err)
}

Expand Down

0 comments on commit 57923d4

Please sign in to comment.