Skip to content

Commit

Permalink
Retry dial and connection errors for grpc stream. (#308)
Browse files Browse the repository at this point in the history
  • Loading branch information
kartlee authored Jun 17, 2020
1 parent 6e2c2ac commit b99e582
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion interceptors/retry/retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,13 @@ func (s *serverStreamingRetryingStream) RecvMsg(m interface{}) error {
callCtx := perCallContext(s.parentCtx, s.callOpts, attempt)
newStream, err := s.reestablishStreamAndResendBuffer(callCtx)
if err != nil {
// TODO(mwitkow): Maybe dial and transport errors should be retriable?
// Retry dial and transport errors of establishing stream as grpc doesn't retry.
if isRetriable(err, s.callOpts) {
continue
}
return err
}

s.setStream(newStream)
attemptRetry, lastErr = s.receiveMsgAndIndicateRetry(m)
//fmt.Printf("Received message and indicate: %v %v\n", attemptRetry, lastErr)
Expand Down

0 comments on commit b99e582

Please sign in to comment.