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

r/pinpoint_event_stream - retry on eventual consistency error #18305

Merged

Conversation

DrFaust92
Copy link
Collaborator

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #15899

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSPinpointEventStream_'
--- PASS: TestAccAWSPinpointEventStream_disappears (92.02s)
--- PASS: TestAccAWSPinpointEventStream_basic (204.16s)

@DrFaust92 DrFaust92 requested a review from a team as a code owner March 19, 2021 15:51
@ghost ghost added size/M Managed by automation to categorize the size of a PR. service/pinpoint Issues and PRs that pertain to the pinpoint service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Mar 19, 2021
@DrFaust92 DrFaust92 added the bug Addresses a defect in current functionality. label Mar 19, 2021
@ewbankkit
Copy link
Contributor

Verified acceptance tests:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSPinpointEventStream_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSPinpointEventStream_ -timeout 180m
=== RUN   TestAccAWSPinpointEventStream_basic
=== PAUSE TestAccAWSPinpointEventStream_basic
=== RUN   TestAccAWSPinpointEventStream_disappears
=== PAUSE TestAccAWSPinpointEventStream_disappears
=== CONT  TestAccAWSPinpointEventStream_basic
=== CONT  TestAccAWSPinpointEventStream_disappears
--- PASS: TestAccAWSPinpointEventStream_disappears (66.57s)
--- PASS: TestAccAWSPinpointEventStream_basic (136.22s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	136.319s

@bflad bflad self-assigned this Mar 25, 2021
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will adjust retry logic on merge, but otherwise looks good. Thank you, @DrFaust92 🚀

Output from acceptance testing in AWS Commercial:

--- PASS: TestAccAWSPinpointEventStream_disappears (71.12s)
--- PASS: TestAccAWSPinpointEventStream_basic (143.79s)

Output from acceptance testing in AWS GovCloud (US):

--- PASS: TestAccAWSPinpointEventStream_disappears (69.10s)
--- PASS: TestAccAWSPinpointEventStream_basic (148.10s)

Comment on lines +57 to +60
// Retry for IAM eventual consistency
_, err := retryOnAwsCode("BadRequestException", func() (interface{}, error) {
return conn.PutEventStream(&req)
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IAM eventual consistency retry logic should follow this Contributing Guide section: https://github.com/hashicorp/terraform-provider-aws/blob/main/docs/contributing/retries-and-waiters.md#iam-error-retries

I would also recommend conditionalizing this based on the error message as well, since BadRequestException by itself could retry on actually malformed requests.

@bflad bflad merged commit 16c4405 into hashicorp:main Mar 25, 2021
@github-actions github-actions bot added this to the v3.34.0 milestone Mar 25, 2021
@ghost
Copy link

ghost commented Mar 26, 2021

This has been released in version 3.34.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@DrFaust92 DrFaust92 deleted the r/pinpoint_event_stream_eventual_consistency branch April 15, 2021 10:34
@ghost
Copy link

ghost commented Apr 24, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Apr 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/pinpoint Issues and PRs that pertain to the pinpoint service. size/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Race condition between pinpoint event stream and dependencies not handled
3 participants