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: apigatewayv2 error handling for ConflictException: Unable to complete operation due to concurrent modification. #29735

Merged
merged 4 commits into from
Mar 10, 2023

Conversation

zjalicf-old
Copy link
Contributor

@zjalicf-old zjalicf-old commented Mar 1, 2023

Description

During automated CI/CD deployment of my application, I noticed the next error in my logs:
ConflictException: Unable to complete operation due to concurrent modification. Please try again later.

This error occurs when steps to add routes to APIGWV2 resource are started, after 6 routes this error happens.

Looking into the way this is handled in aws provider for apigateway (ver1), I have implemented the same error handling for apigatewayv2.

Relations

Closes #18018.

Output from Acceptance Testing

Since this is a simple change I believe tests are not needed.

@github-actions
Copy link

github-actions bot commented Mar 1, 2023

Community Note

Voting for Prioritization

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

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • 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 size/XS Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. client-connections Pertains to the AWS Client and service connections. labels Mar 1, 2023
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome @zjalicf-cyberlab 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTOR guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@zjalicf-old zjalicf-old changed the title adding apigatewayv2 and error handling fix: apigatewayv2 error handling for ConflictException: Unable to complete operation due to concurrent modification. Mar 1, 2023
@ewbankkit ewbankkit added enhancement Requests to existing resources that expand the functionality or scope. service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service. and removed needs-triage Waiting for first response or review from a maintainer. client-connections Pertains to the AWS Client and service connections. labels Mar 10, 2023
@ewbankkit ewbankkit self-assigned this Mar 10, 2023
@github-actions github-actions bot added client-connections Pertains to the AWS Client and service connections. and removed client-connections Pertains to the AWS Client and service connections. service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service. labels Mar 10, 2023
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 🚀.

% make testacc TESTARGS='-run=TestAccAPIGatewayV2Integration_\|TestAccAPIGatewayV2Route_' PKG=apigatewayv2 ACCTEST_PARALLELISM=5
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/apigatewayv2/... -v -count 1 -parallel 5  -run=TestAccAPIGatewayV2Integration_\|TestAccAPIGatewayV2Route_ -timeout 180m
=== RUN   TestAccAPIGatewayV2Integration_basicWebSocket
=== PAUSE TestAccAPIGatewayV2Integration_basicWebSocket
=== RUN   TestAccAPIGatewayV2Integration_basicHTTP
=== PAUSE TestAccAPIGatewayV2Integration_basicHTTP
=== RUN   TestAccAPIGatewayV2Integration_disappears
=== PAUSE TestAccAPIGatewayV2Integration_disappears
=== RUN   TestAccAPIGatewayV2Integration_dataMappingHTTP
=== PAUSE TestAccAPIGatewayV2Integration_dataMappingHTTP
=== RUN   TestAccAPIGatewayV2Integration_integrationTypeHTTP
=== PAUSE TestAccAPIGatewayV2Integration_integrationTypeHTTP
=== RUN   TestAccAPIGatewayV2Integration_lambdaWebSocket
=== PAUSE TestAccAPIGatewayV2Integration_lambdaWebSocket
=== RUN   TestAccAPIGatewayV2Integration_lambdaHTTP
=== PAUSE TestAccAPIGatewayV2Integration_lambdaHTTP
=== RUN   TestAccAPIGatewayV2Integration_vpcLinkWebSocket
=== PAUSE TestAccAPIGatewayV2Integration_vpcLinkWebSocket
=== RUN   TestAccAPIGatewayV2Integration_vpcLinkHTTP
=== PAUSE TestAccAPIGatewayV2Integration_vpcLinkHTTP
=== RUN   TestAccAPIGatewayV2Integration_serviceIntegration
=== PAUSE TestAccAPIGatewayV2Integration_serviceIntegration
=== RUN   TestAccAPIGatewayV2Route_basic
=== PAUSE TestAccAPIGatewayV2Route_basic
=== RUN   TestAccAPIGatewayV2Route_disappears
=== PAUSE TestAccAPIGatewayV2Route_disappears
=== RUN   TestAccAPIGatewayV2Route_authorizer
=== PAUSE TestAccAPIGatewayV2Route_authorizer
=== RUN   TestAccAPIGatewayV2Route_jwtAuthorization
=== PAUSE TestAccAPIGatewayV2Route_jwtAuthorization
=== RUN   TestAccAPIGatewayV2Route_model
=== PAUSE TestAccAPIGatewayV2Route_model
=== RUN   TestAccAPIGatewayV2Route_requestParameters
=== PAUSE TestAccAPIGatewayV2Route_requestParameters
=== RUN   TestAccAPIGatewayV2Route_simpleAttributes
=== PAUSE TestAccAPIGatewayV2Route_simpleAttributes
=== RUN   TestAccAPIGatewayV2Route_target
=== PAUSE TestAccAPIGatewayV2Route_target
=== RUN   TestAccAPIGatewayV2Route_updateRouteKey
=== PAUSE TestAccAPIGatewayV2Route_updateRouteKey
=== CONT  TestAccAPIGatewayV2Integration_basicWebSocket
=== CONT  TestAccAPIGatewayV2Route_basic
=== CONT  TestAccAPIGatewayV2Route_requestParameters
=== CONT  TestAccAPIGatewayV2Route_jwtAuthorization
=== CONT  TestAccAPIGatewayV2Route_model
--- PASS: TestAccAPIGatewayV2Integration_basicWebSocket (24.62s)
=== CONT  TestAccAPIGatewayV2Route_authorizer
--- PASS: TestAccAPIGatewayV2Route_basic (25.03s)
=== CONT  TestAccAPIGatewayV2Integration_vpcLinkHTTP
--- PASS: TestAccAPIGatewayV2Route_model (25.46s)
=== CONT  TestAccAPIGatewayV2Integration_serviceIntegration
=== CONT  TestAccAPIGatewayV2Integration_vpcLinkHTTP
    integration_test.go:457: Step 1/4 error: Error running apply: exit status 1
        
        Error: reading EC2 VPC (vpc-0bc6d48f1349e9535) Attribute (enableDnsHostnames): couldn't find resource
        
          with aws_vpc.test,
          on terraform_plugin_test.tf line 7, in resource "aws_vpc" "test":
           7: resource "aws_vpc" "test" {
        
--- FAIL: TestAccAPIGatewayV2Integration_vpcLinkHTTP (11.56s)
=== CONT  TestAccAPIGatewayV2Integration_vpcLinkWebSocket
--- PASS: TestAccAPIGatewayV2Route_requestParameters (50.18s)
=== CONT  TestAccAPIGatewayV2Route_disappears
--- PASS: TestAccAPIGatewayV2Route_jwtAuthorization (56.22s)
=== CONT  TestAccAPIGatewayV2Integration_lambdaHTTP
--- PASS: TestAccAPIGatewayV2Route_disappears (17.82s)
=== CONT  TestAccAPIGatewayV2Integration_lambdaWebSocket
--- PASS: TestAccAPIGatewayV2Integration_serviceIntegration (60.08s)
=== CONT  TestAccAPIGatewayV2Route_target
--- PASS: TestAccAPIGatewayV2Route_authorizer (62.55s)
=== CONT  TestAccAPIGatewayV2Route_updateRouteKey
--- PASS: TestAccAPIGatewayV2Integration_lambdaHTTP (45.32s)
=== CONT  TestAccAPIGatewayV2Route_simpleAttributes
--- PASS: TestAccAPIGatewayV2Route_target (20.47s)
=== CONT  TestAccAPIGatewayV2Integration_dataMappingHTTP
--- PASS: TestAccAPIGatewayV2Integration_lambdaWebSocket (39.57s)
=== CONT  TestAccAPIGatewayV2Integration_disappears
--- PASS: TestAccAPIGatewayV2Route_updateRouteKey (33.01s)
=== CONT  TestAccAPIGatewayV2Integration_integrationTypeHTTP
--- PASS: TestAccAPIGatewayV2Integration_disappears (17.13s)
=== CONT  TestAccAPIGatewayV2Integration_basicHTTP
--- PASS: TestAccAPIGatewayV2Integration_dataMappingHTTP (33.52s)
--- PASS: TestAccAPIGatewayV2Integration_basicHTTP (20.96s)
--- PASS: TestAccAPIGatewayV2Route_simpleAttributes (46.75s)
--- PASS: TestAccAPIGatewayV2Integration_integrationTypeHTTP (32.92s)
--- PASS: TestAccAPIGatewayV2Integration_vpcLinkWebSocket (703.49s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/apigatewayv2	745.515s
FAIL
make: *** [testacc] Error 1

The failure is unrelated to this change.

@ewbankkit
Copy link
Contributor

@zjalicf-cyberlab Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 699dd0c into hashicorp:main Mar 10, 2023
@github-actions github-actions bot added this to the v4.59.0 milestone Mar 10, 2023
@zjalicf-old
Copy link
Contributor Author

Thank you @ewbankkit :D

@github-actions
Copy link

This functionality has been released in v4.59.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. Thank you!

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API Gateway v2 integration & route: ConflictException due to concurrent modification
2 participants