Skip to content

Commit

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

Fixes #4437
  • Loading branch information
tritone committed Jul 14, 2021
1 parent 4f7193b commit 09879ea
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 09879ea

Please sign in to comment.