Skip to content

Commit

Permalink
fix(storage): drop stream reference after closing it for gRPC writes (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
BrennaEpp authored Oct 27, 2023
1 parent 42180cf commit 525abde
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions storage/grpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1660,6 +1660,10 @@ func (w *gRPCWriter) uploadBuffer(recvd int, start int64, doneReading bool) (*st
// status. Closing the stream receives the status as an error.
_, err = w.stream.CloseAndRecv()

// Drop the stream reference as a new one will need to be created if
// we can retry the upload
w.stream = nil

// Retriable errors mean we should start over and attempt to
// resend the entire buffer via a new stream.
// If not retriable, falling through will return the error received
Expand Down

0 comments on commit 525abde

Please sign in to comment.