Skip to content

Commit 96ef884

Browse files
authored
fix: do not set timeout for stream initialization (#645)
1 parent 4679fb1 commit 96ef884

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

interceptors/retry/retry.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,8 @@ func StreamClientInterceptor(optFuncs ...CallOption) grpc.StreamClientIntercepto
9494
if err := waitRetryBackoff(attempt, parentCtx, callOpts); err != nil {
9595
return nil, err
9696
}
97-
callCtx, cancel := perCallContext(parentCtx, callOpts, 0)
98-
defer cancel() // Clean up potential resources.
9997
var newStreamer grpc.ClientStream
100-
newStreamer, lastErr = streamer(callCtx, desc, cc, method, grpcOpts...)
98+
newStreamer, lastErr = streamer(parentCtx, desc, cc, method, grpcOpts...)
10199
if lastErr == nil {
102100
retryingStreamer := &serverStreamingRetryingStream{
103101
ClientStream: newStreamer,
@@ -188,9 +186,7 @@ func (s *serverStreamingRetryingStream) RecvMsg(m any) error {
188186
return err
189187
}
190188
s.callOpts.onRetryCallback(s.parentCtx, attempt, lastErr)
191-
// TODO(bwplotka): Close cancel as it might leak some resources.
192-
callCtx, _ := perCallContext(s.parentCtx, s.callOpts, attempt) //nolint
193-
newStream, err := s.reestablishStreamAndResendBuffer(callCtx)
189+
newStream, err := s.reestablishStreamAndResendBuffer(s.parentCtx)
194190
if err != nil {
195191
// Retry dial and transport errors of establishing stream as grpc doesn't retry.
196192
if isRetriable(err, s.callOpts) {

0 commit comments

Comments
 (0)