From 09879ea80cb67f9bfd8fc9384b0fda335567cba9 Mon Sep 17 00:00:00 2001 From: Chris Cotter Date: Wed, 14 Jul 2021 18:58:12 -0400 Subject: [PATCH] fix(storage): retry LockRetentionPolicy (#4439) 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.