Skip to content

Commit e8f09a3

Browse files
committed
pr feedback
1 parent 392fffd commit e8f09a3

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

internal/command/command_service.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -560,11 +560,6 @@ func (cs *CommandService) connectCallback(
560560

561561
validatedError := grpc.ValidateGrpcError(connectErr)
562562
if validatedError != nil {
563-
codeError, ok := status.FromError(validatedError)
564-
if ok && codeError.Message() == "grpc: the client connection is closing" {
565-
return nil, backoff.Permanent(fmt.Errorf("failed to create connection: %w, "+
566-
"stopping retry", validatedError))
567-
}
568563
slog.ErrorContext(ctx, "Failed to create connection", "error", validatedError)
569564

570565
return nil, validatedError

internal/grpc/grpc.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,8 @@ func ProtoValidatorStreamClientInterceptor() (grpc.StreamClientInterceptor, erro
353353
func ValidateGrpcError(err error) error {
354354
if err != nil {
355355
if statusError, ok := status.FromError(err); ok {
356-
if statusError.Code() == codes.InvalidArgument || statusError.Code() == codes.Unimplemented {
356+
if statusError.Code() == codes.InvalidArgument || statusError.Code() == codes.Unimplemented ||
357+
statusError.Code() == codes.Canceled {
357358
return backoff.Permanent(err)
358359
}
359360
}

0 commit comments

Comments
 (0)