Skip to content

Commit

Permalink
fix: do not set timeout for stream initialization (#645)
Browse files Browse the repository at this point in the history
  • Loading branch information
DavyJohnes authored Sep 19, 2023
1 parent 4679fb1 commit 96ef884
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions interceptors/retry/retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,8 @@ func StreamClientInterceptor(optFuncs ...CallOption) grpc.StreamClientIntercepto
if err := waitRetryBackoff(attempt, parentCtx, callOpts); err != nil {
return nil, err
}
callCtx, cancel := perCallContext(parentCtx, callOpts, 0)
defer cancel() // Clean up potential resources.
var newStreamer grpc.ClientStream
newStreamer, lastErr = streamer(callCtx, desc, cc, method, grpcOpts...)
newStreamer, lastErr = streamer(parentCtx, desc, cc, method, grpcOpts...)
if lastErr == nil {
retryingStreamer := &serverStreamingRetryingStream{
ClientStream: newStreamer,
Expand Down Expand Up @@ -188,9 +186,7 @@ func (s *serverStreamingRetryingStream) RecvMsg(m any) error {
return err
}
s.callOpts.onRetryCallback(s.parentCtx, attempt, lastErr)
// TODO(bwplotka): Close cancel as it might leak some resources.
callCtx, _ := perCallContext(s.parentCtx, s.callOpts, attempt) //nolint
newStream, err := s.reestablishStreamAndResendBuffer(callCtx)
newStream, err := s.reestablishStreamAndResendBuffer(s.parentCtx)
if err != nil {
// Retry dial and transport errors of establishing stream as grpc doesn't retry.
if isRetriable(err, s.callOpts) {
Expand Down

0 comments on commit 96ef884

Please sign in to comment.