Skip to content

Commit 525abde

Browse files
authored
fix(storage): drop stream reference after closing it for gRPC writes (googleapis#8872)
1 parent 42180cf commit 525abde

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

storage/grpc_client.go

+4
Original file line numberDiff line numberDiff line change
@@ -1660,6 +1660,10 @@ func (w *gRPCWriter) uploadBuffer(recvd int, start int64, doneReading bool) (*st
16601660
// status. Closing the stream receives the status as an error.
16611661
_, err = w.stream.CloseAndRecv()
16621662

1663+
// Drop the stream reference as a new one will need to be created if
1664+
// we can retry the upload
1665+
w.stream = nil
1666+
16631667
// Retriable errors mean we should start over and attempt to
16641668
// resend the entire buffer via a new stream.
16651669
// If not retriable, falling through will return the error received

0 commit comments

Comments
 (0)