-
Notifications
You must be signed in to change notification settings - Fork 949
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
optimizate jobflow controller to reduce invalid reconcile #3441
base: master
Are you sure you want to change the base?
optimizate jobflow controller to reduce invalid reconcile #3441
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: calvin <wen.chen@daocloud.io>
fb66ac0
to
a6fad98
Compare
@@ -63,7 +65,26 @@ func (jf *jobflowcontroller) syncJobFlow(jobFlow *v1alpha1flow.JobFlow, updateSt | |||
} | |||
jobFlow.Status = *jobFlowStatus | |||
updateStateFn(&jobFlow.Status, len(jobFlow.Spec.Flows)) | |||
_, err = jf.vcClient.FlowV1alpha1().JobFlows(jobFlow.Namespace).UpdateStatus(context.Background(), jobFlow, metav1.UpdateOptions{}) | |||
|
|||
err = retry.RetryOnConflict(retry.DefaultRetry, func() error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the retry mechanism after resource version conflicts to avoid the next reconcile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's truly a problem, but this way seems will be more time consuming.
@@ -281,6 +302,12 @@ func (jf *jobflowcontroller) deleteAllJobsCreatedByJobFlow(jobFlow *v1alpha1flow | |||
for _, job := range jobList { | |||
err := jf.vcClient.BatchV1alpha1().Jobs(jobFlow.Namespace).Delete(context.Background(), job.Name, metav1.DeleteOptions{}) | |||
if err != nil { | |||
if apierrors.IsNotFound(err) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ingnore this error return if the job no longer exist.
/auto-cc |
@lowang-bh @hwdef PTAL |
I found a some bit err message when using jobflow feature, I create a jobflow resource ref:
https://github.com/volcano-sh/volcano/blob/master/example/jobflow/JobFlow.yaml
https://github.com/volcano-sh/volcano/blob/master/example/jobflow/JobTemplate.yaml
here's controller manager logs:
The pr focuses only on jobflow_controllers.go errors.