Skip to content

Commit

Permalink
fix(storage): retry LockRetentionPolicy
Browse files Browse the repository at this point in the history
This call is fully idempotent and retryable according to
go/gcs-api-retry-guidance.

Fixes googleapis#4437
  • Loading branch information
tritone committed Jul 14, 2021
1 parent 4f7193b commit 634c240
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions storage/bucket.go
Expand Up @@ -949,8 +949,10 @@ func (b *BucketHandle) LockRetentionPolicy(ctx context.Context) error {
metageneration = b.conds.MetagenerationMatch
}
req := b.c.raw.Buckets.LockRetentionPolicy(b.name, metageneration)
_, err := req.Context(ctx).Do()
return err
return runWithRetry(ctx, func() error {
_, err := req.Context(ctx).Do()
return err
})
}

// applyBucketConds modifies the provided call using the conditions in conds.
Expand Down

0 comments on commit 634c240

Please sign in to comment.