From 634c240fe5f84c3d946b3d0524c768ad55d5405d Mon Sep 17 00:00:00 2001 From: Chris Cotter Date: Wed, 14 Jul 2021 17:38:31 -0400 Subject: [PATCH] fix(storage): retry LockRetentionPolicy This call is fully idempotent and retryable according to go/gcs-api-retry-guidance. Fixes #4437 --- storage/bucket.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/storage/bucket.go b/storage/bucket.go index 7208f577e66..8066c708e40 100644 --- a/storage/bucket.go +++ b/storage/bucket.go @@ -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.