Skip to content

Commit

Permalink
Add database retry for another exit code (255) (#6926)
Browse files Browse the repository at this point in the history
  • Loading branch information
siggisim authored Jun 26, 2024
1 parent 06f1877 commit 69e850e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ const (
podmanInternalExitCode = 125
podmanCommandNotRunnableExitCode = 126
podmanCommandNotFoundExitCode = 127
podmanCommandOutOfRangeExitCode = 255

// podmanExecSIGKILLExitCode is the exit code returned by `podman exec` when the exec
// process is killed due to the parent container being removed.
Expand Down Expand Up @@ -787,7 +788,8 @@ func runPodman(ctx context.Context, commandRunner interfaces.CommandRunner, podm
// locked". Detect these and return a retryable error.
if (result.ExitCode == podmanCommandNotRunnableExitCode ||
result.ExitCode == podmanInternalExitCode ||
result.ExitCode == podmanCommandNotFoundExitCode) &&
result.ExitCode == podmanCommandNotFoundExitCode ||
result.ExitCode == podmanCommandOutOfRangeExitCode) &&
databaseLockedRegexp.Match(result.Stderr) {
result.ExitCode = commandutil.NoExitCode
result.Error = status.UnavailableErrorf("podman failed: %q", strings.TrimSpace(string(result.Stderr)))
Expand Down

0 comments on commit 69e850e

Please sign in to comment.