Skip to content

Commit

Permalink
Merge pull request #12949 from nijave/nv-retry-s3-ops-in-progress-errors
Browse files Browse the repository at this point in the history
Retry S3 OperationAborted errors
  • Loading branch information
YakDriver authored Nov 19, 2021
2 parents 8f298ae + e8a8982 commit 9e0b7e9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .changelog/12949.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
```release-note:bug
resource/aws_s3_bucket: Prevent `OperationAborted` conflict errors when simultaneously applying `aws_s3_bucket_policy`, `aws_s3_bucket_public_access_block` changes
```

```release-note:bug
resource/aws_s3_bucket_policy: Prevent `OperationAborted` conflict errors when simultaneously applying `aws_s3_bucket`, `aws_s3_bucket_public_access_block` changes
```

```release-note:bug
resource/aws_s3_bucket_public_access_block: Prevent `OperationAborted` conflict errors when simultaneously applying `aws_s3_bucket_policy`, `aws_s3_bucket` changes
```
6 changes: 6 additions & 0 deletions internal/conns/conns.go
Original file line number Diff line number Diff line change
Expand Up @@ -1740,6 +1740,12 @@ func (c *Config) Client() (interface{}, error) {
}
})

client.S3Conn.Handlers.Retry.PushBack(func(r *request.Request) {
if tfawserr.ErrMessageContains(r.Error, "OperationAborted", "A conflicting conditional operation is currently in progress against this resource. Please try again.") {
r.Retryable = aws.Bool(true)
}
})

// Reference: https://github.com/hashicorp/terraform-provider-aws/issues/17996
client.SecurityHubConn.Handlers.Retry.PushBack(func(r *request.Request) {
switch r.Operation.Name {
Expand Down

0 comments on commit 9e0b7e9

Please sign in to comment.