Skip to content

Commit

Permalink
chore(storage): fix retry propagation for gRPC (googleapis#6762)
Browse files Browse the repository at this point in the history
I missed a case where the shouldRetry function could be nil
in googleapis#6754, which causes a panic in integration tests.

Fixes googleapis#6760 (this is the actual failure)
Fixes googleapis#6757
Fixes googleapis#6758
Fixes googleapis#6759
  • Loading branch information
tritone authored and kimihrr committed Sep 28, 2022
1 parent 19ff48a commit 6863560
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions storage/grpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1399,7 +1399,7 @@ func (r *gRPCReader) Close() error {
func (r *gRPCReader) recv() (*storagepb.ReadObjectResponse, error) {
msg, err := r.stream.Recv()
var shouldRetry = ShouldRetry
if r.settings.retry != nil {
if r.settings.retry != nil && r.settings.retry.shouldRetry != nil {
shouldRetry = r.settings.retry.shouldRetry
}
if err != nil && shouldRetry(err) {
Expand Down Expand Up @@ -1520,7 +1520,7 @@ func (w *gRPCWriter) uploadBuffer(recvd int, start int64, doneReading bool) (*st
var finishWrite bool
var sent, limit int = 0, maxPerMessageWriteSize
var shouldRetry = ShouldRetry
if w.settings.retry != nil {
if w.settings.retry != nil && w.settings.retry.shouldRetry != nil {
shouldRetry = w.settings.retry.shouldRetry
}
offset := start
Expand Down

0 comments on commit 6863560

Please sign in to comment.