Skip to content

Commit 09879ea

Browse files
authored
fix(storage): retry LockRetentionPolicy (#4439)
This call is fully idempotent and retryable according to go/gcs-api-retry-guidance. Fixes #4437
1 parent 4f7193b commit 09879ea

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎storage/bucket.go‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -949,8 +949,10 @@ func (b *BucketHandle) LockRetentionPolicy(ctx context.Context) error {
949949
metageneration = b.conds.MetagenerationMatch
950950
}
951951
req := b.c.raw.Buckets.LockRetentionPolicy(b.name, metageneration)
952-
_, err := req.Context(ctx).Do()
953-
return err
952+
return runWithRetry(ctx, func() error {
953+
_, err := req.Context(ctx).Do()
954+
return err
955+
})
954956
}
955957

956958
// applyBucketConds modifies the provided call using the conditions in conds.

0 commit comments

Comments
 (0)