Skip to content

Conversation

jar-b
Copy link
Member

@jar-b jar-b commented Aug 28, 2025

Description

All generated service clients contain a functional option which overrides the default retryer with additional handling for go-vcr-specific errors. However, a handful of service clients include additional hand-written options which also override the default retryer, typically addressing some nuance related to error codes unique to a given service. To ensure these service-local overrides do not overwrite the go-vcr handling, the extra options implementations have been modified to merge both sets of retryables.

Relations

Closes #42949
Relates #25602
Relates #42801

Output from Acceptance Testing

Example of a go-vcr failure which previously hung due to unintentional retries on the EC2 client. This now fails immediately once the first go-vcr error is encountered (as desired).

% VCR_MODE=REPLAY_ONLY VCR_PATH=/Users/jaredbaker/development/_vcr-testdata/ make testacc PKG=timestreaminfluxdb TESTS=TestAccTimestreamInfluxDBDBCluster_basic
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.24.6 test ./internal/service/timestreaminfluxdb/... -v -count 1 -parallel 20 -run='TestAccTimestreamInfluxDBDBCluster_basic'  -timeout 360m -vet=off
2025/08/28 14:41:43 Creating Terraform AWS Provider (SDKv2-style)...
2025/08/28 14:41:43 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccTimestreamInfluxDBDBCluster_basic
=== PAUSE TestAccTimestreamInfluxDBDBCluster_basic
=== CONT  TestAccTimestreamInfluxDBDBCluster_basic
    db_cluster_test.go:35: Step 1/2 error: Error running apply: exit status 1

        Error: creating Security Group (terraform-20250828184146602500000001): operation error EC2: CreateSecurityGroup, https response error StatusCode: 0, RequestID: , request send failed, Post "https://ec2.us-west-2.amazonaws.com/": requested interaction not found

          with aws_security_group.test,
          on terraform_plugin_test.tf line 42, in resource "aws_security_group" "test":
          42: resource "aws_security_group" "test" {

--- FAIL: TestAccTimestreamInfluxDBDBCluster_basic (5.38s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-aws/internal/service/timestreaminfluxdb 11.930s
FAIL
make: *** [testacc] Error 1

…xtra options

All generated service clients contain a functional option which overrides the default retryer with additional handling for `go-vcr`-specific errors. However, a handful of service clients include additional hand-written options which _also_ override the default retryer, typically addressing some nuance related to error codes unique to a given service. To ensure these service-local overrides do not overwrite the `go-vcr` handling, the extra options implementations have been modified to merge both sets of retryables.
Copy link
Contributor

Community Guidelines

This comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀

Voting for Prioritization

  • Please vote on this Pull Request by adding a 👍 reaction to the original post to help the community and maintainers prioritize it.
  • Please see our prioritization guide for additional information on how the maintainers handle prioritization.
  • Please do not leave +1 or other comments that do not add relevant new information or questions; they generate extra noise for others following the Pull Request and do not help prioritize the request.

Pull Request Authors

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added service/s3 Issues and PRs that pertain to the s3 service. service/apigateway Issues and PRs that pertain to the apigateway service. service/lightsail Issues and PRs that pertain to the lightsail service. service/dynamodb Issues and PRs that pertain to the dynamodb service. service/organizations Issues and PRs that pertain to the organizations service. service/appsync Issues and PRs that pertain to the appsync service. service/kinesis Issues and PRs that pertain to the kinesis service. service/cloudformation Issues and PRs that pertain to the cloudformation service. service/cloudhsmv2 Issues and PRs that pertain to the cloudhsmv2 service. service/fms Issues and PRs that pertain to the fms service. service/kafka Issues and PRs that pertain to the kafka service. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service. service/ssoadmin Issues and PRs that pertain to the ssoadmin service. service/schemas Issues and PRs that pertain to the schemas service. size/XL Managed by automation to categorize the size of a PR. labels Aug 28, 2025
@jar-b jar-b force-pushed the td-govcr-retry-overrides branch from 7e7ae66 to f831719 Compare August 28, 2025 17:43
@jar-b jar-b marked this pull request as ready for review August 28, 2025 18:44
@jar-b jar-b requested a review from a team as a code owner August 28, 2025 18:44
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

@jar-b jar-b merged commit 518167a into main Aug 29, 2025
55 checks passed
@jar-b jar-b deleted the td-govcr-retry-overrides branch August 29, 2025 14:45
Copy link
Contributor

Warning

This Issue has been closed, meaning that any additional comments are much easier for the maintainers to miss. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. service/apigateway Issues and PRs that pertain to the apigateway service. service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service. service/appsync Issues and PRs that pertain to the appsync service. service/cloudformation Issues and PRs that pertain to the cloudformation service. service/cloudhsmv2 Issues and PRs that pertain to the cloudhsmv2 service. service/dynamodb Issues and PRs that pertain to the dynamodb service. service/fms Issues and PRs that pertain to the fms service. service/kafka Issues and PRs that pertain to the kafka service. service/kinesis Issues and PRs that pertain to the kinesis service. service/lightsail Issues and PRs that pertain to the lightsail service. service/organizations Issues and PRs that pertain to the organizations service. service/s3 Issues and PRs that pertain to the s3 service. service/schemas Issues and PRs that pertain to the schemas service. service/ssoadmin Issues and PRs that pertain to the ssoadmin service. size/XL Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Go-VCR: Account for clients with extra options containing Retryer overrides
2 participants