Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not set timeout for stream initialization #645

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading