Skip to content

Commit

Permalink
fix(executor): Replace default retry in executor with an increased va…
Browse files Browse the repository at this point in the history
…lue retryer (#3891)
  • Loading branch information
anggao authored and alexec committed Sep 2, 2020
1 parent ae537cd commit 4b30fa4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions workflow/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ import (
os_specific "github.com/argoproj/argo/workflow/executor/os-specific"
)

var MainContainerStartRetry = wait.Backoff{
// ExecutorRetry is a retry backoff settings for WorkflowExecutor
var ExecutorRetry = wait.Backoff{
Steps: 8,
Duration: 1 * time.Second,
Factor: 1.0,
Expand Down Expand Up @@ -621,7 +622,7 @@ func (we *WorkflowExecutor) getPod() (*apiv1.Pod, error) {
podsIf := we.ClientSet.CoreV1().Pods(we.Namespace)
var pod *apiv1.Pod
var err error
_ = wait.ExponentialBackoff(retry.DefaultRetry, func() (bool, error) {
_ = wait.ExponentialBackoff(ExecutorRetry, func() (bool, error) {
pod, err = podsIf.Get(we.PodName, metav1.GetOptions{})
if err != nil {
log.Warnf("Failed to get pod '%s': %v", we.PodName, err)
Expand Down Expand Up @@ -922,7 +923,7 @@ func (we *WorkflowExecutor) Wait() error {
annotationUpdatesCh := we.monitorAnnotations(ctx)
go we.monitorDeadline(ctx, annotationUpdatesCh)

_ = wait.ExponentialBackoff(retry.DefaultRetry, func() (bool, error) {
_ = wait.ExponentialBackoff(ExecutorRetry, func() (bool, error) {
err = we.RuntimeExecutor.Wait(mainContainerID)
if err != nil {
log.Warnf("Failed to wait for container id '%s': %v", mainContainerID, err)
Expand All @@ -949,7 +950,7 @@ func (we *WorkflowExecutor) waitMainContainerStart() (string, error) {
var err error
var watchIf watch.Interface

err = wait.ExponentialBackoff(MainContainerStartRetry, func() (bool, error) {
err = wait.ExponentialBackoff(ExecutorRetry, func() (bool, error) {
watchIf, err = podsIf.Watch(opts)
if err != nil {
log.Debugf("Failed to establish watch, retrying: %v", err)
Expand Down

0 comments on commit 4b30fa4

Please sign in to comment.