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 Aug 31, 2020
1 parent b681c11 commit bb79e3f
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 @@ -41,7 +41,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 @@ -620,7 +621,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 @@ -921,7 +922,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 @@ -948,7 +949,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 bb79e3f

Please sign in to comment.