Skip to content

Commit

Permalink
Update retry logic for k8s executor logs
Browse files Browse the repository at this point in the history
  • Loading branch information
lbeckman314 committed Jan 30, 2025
1 parent e26a314 commit 86900f4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions worker/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func (kcmd KubernetesCommand) Run(ctx context.Context) error {
if err != nil {
// Retry creating the Executor Pod on failure
var retryCount int
for retryCount < 3 {
for retryCount < 5 {
_, err = client.Create(ctx, job, metav1.CreateOptions{})
if err == nil {
break
Expand All @@ -107,7 +107,7 @@ func (kcmd KubernetesCommand) Run(ctx context.Context) error {
time.Sleep(2 * time.Second)
}
if retryCount == 3 {
return fmt.Errorf("creating job in worker after 3 attempts: %v", err)
return fmt.Errorf("Funnel Worker: Failed to create Executor Job after 3 attempts: %v", err)
}
}

Expand All @@ -128,7 +128,7 @@ func (kcmd KubernetesCommand) Run(ctx context.Context) error {
if err != nil {
// Retry reading the Executor Logs on failure
var retryCount int
for retryCount < 3 {
for retryCount < 5 {
podLogs, err := req.Stream(ctx)
if err == nil {
defer podLogs.Close()
Expand All @@ -143,8 +143,8 @@ func (kcmd KubernetesCommand) Run(ctx context.Context) error {
retryCount++
time.Sleep(2 * time.Second)
}
if retryCount == 3 {
return fmt.Errorf("failed to read logs after 3 attempts: %v", err)
if retryCount == 5 {
return fmt.Errorf("Funnel Worker: Failed to read Executor Logs after 5 attempts: %v", err)
}
return err
}
Expand Down

0 comments on commit 86900f4

Please sign in to comment.