From 4b30fa4ef82acba373b9e0d33809f63aa3c2632b Mon Sep 17 00:00:00 2001 From: Ang Gao Date: Mon, 31 Aug 2020 20:07:32 +0100 Subject: [PATCH] fix(executor): Replace default retry in executor with an increased value retryer (#3891) --- workflow/executor/executor.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/workflow/executor/executor.go b/workflow/executor/executor.go index fc35dd327b2f..4876262d9f11 100644 --- a/workflow/executor/executor.go +++ b/workflow/executor/executor.go @@ -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, @@ -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) @@ -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) @@ -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)