Skip to content

Commit

Permalink
fix: retry create workflow on transient error
Browse files Browse the repository at this point in the history
Signed-off-by: Tianchu Zhao <[email protected]>
  • Loading branch information
tczhao committed Dec 5, 2024
1 parent b966acc commit 0919980
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion workflow/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,13 @@ func SubmitWorkflow(ctx context.Context, wfIf v1alpha1.WorkflowInterface, wfClie
}
return wf, err
} else {
return wfIf.Create(ctx, wf, metav1.CreateOptions{})
var runWf *wfv1.Workflow
err = waitutil.Backoff(retry.DefaultRetry, func() (bool, error) {
var err error
runWf, err = wfIf.Create(ctx, wf, metav1.CreateOptions{})
return !errorsutil.IsTransientErr(err), err
})
return runWf, err
}
}

Expand Down

0 comments on commit 0919980

Please sign in to comment.