Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove retry in read as retry for create/update is already handled in respective methods #19963

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/12028.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note: bug
storage: removed retry on 404s during refresh for `google_storage_bucket`, preventing hanging when refreshing deleted buckets
```
11 changes: 1 addition & 10 deletions google/services/storage/resource_storage_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -963,18 +963,9 @@ func resourceStorageBucketRead(d *schema.ResourceData, meta interface{}) error {
// Get the bucket and acl
bucket := d.Get("name").(string)

var res *storage.Bucket
// There seems to be some eventual consistency errors in some cases, so we want to check a few times
// to make sure it exists before moving on
err = transport_tpg.Retry(transport_tpg.RetryOptions{
RetryFunc: func() (operr error) {
var retryErr error
res, retryErr = config.NewStorageClient(userAgent).Buckets.Get(bucket).Do()
return retryErr
},
Timeout: d.Timeout(schema.TimeoutRead),
ErrorRetryPredicates: []transport_tpg.RetryErrorPredicateFunc{transport_tpg.IsNotFoundRetryableError("bucket read")},
})
res, err := config.NewStorageClient(userAgent).Buckets.Get(bucket).Do()

if err != nil {
return transport_tpg.HandleNotFoundError(err, d, fmt.Sprintf("Storage Bucket %q", d.Get("name").(string)))
Expand Down