Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package argo

import (
"context"
"errors"
"fmt"
"log/slog"
"strings"
Expand Down Expand Up @@ -76,6 +77,9 @@ func isRetryableError(err error) bool {
if err == nil {
return false
}
if errors.Is(err, context.DeadlineExceeded) {
return true
}
errStr := err.Error()
return strings.Contains(errStr, "502") ||
strings.Contains(errStr, "503") ||
Expand All @@ -85,7 +89,8 @@ func isRetryableError(err error) bool {
strings.Contains(errStr, "timeout") ||
strings.Contains(errStr, "temporarily unavailable") ||
strings.Contains(errStr, "EOF") ||
strings.Contains(errStr, "Unavailable")
strings.Contains(errStr, "Unavailable") ||
strings.Contains(errStr, "context deadline exceeded")
Comment on lines 80 to +93
}

// GoApplicationDeleter is the production implementation of
Expand Down
6 changes: 6 additions & 0 deletions apps/workspace-engine/pkg/jobagents/argo/argoapp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,12 @@ func TestIsRetryableError(t *testing.T) {
{"Unavailable", fmt.Errorf("Unavailable"), true},
{"not found", fmt.Errorf("application not found"), false},
{"permission denied", fmt.Errorf("permission denied"), false},
{"context deadline exceeded sentinel", context.DeadlineExceeded, true},
{
"context deadline exceeded grpc status",
status.Error(codes.DeadlineExceeded, "context deadline exceeded"),
true,
},
}

for _, tt := range tests {
Expand Down
Loading