Skip to content

Commit

Permalink
Exclude codes.DeadlineExceeded from the list of retryable gRPC codes (t…
Browse files Browse the repository at this point in the history
  • Loading branch information
alexshtin authored Jan 26, 2024
1 parent 94a5f5f commit 536b875
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/common/retry/interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,12 @@ var (
// gRPC response codes that represent retryable errors.
// The following status codes are never generated by the library:
// INVALID_ARGUMENT, NOT_FOUND, ALREADY_EXISTS, FAILED_PRECONDITION, ABORTED, OUT_OF_RANGE, DATA_LOSS
retryableCodes = []codes.Code{codes.Aborted, codes.DeadlineExceeded, codes.Internal,
// codes.DeadlineExceeded and codes.Canceled are not here (and shouldn't be here!)
// because they are coming from go context and "context errors are not retriable based on user settings"
// by gRPC library.
retryableCodes = []codes.Code{codes.Aborted, codes.Internal,
codes.ResourceExhausted, codes.Unavailable, codes.Unknown}
retryableCodesWithoutInternal = []codes.Code{codes.Aborted, codes.DeadlineExceeded,
retryableCodesWithoutInternal = []codes.Code{codes.Aborted,
codes.ResourceExhausted, codes.Unavailable, codes.Unknown}
)

Expand Down

0 comments on commit 536b875

Please sign in to comment.