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

service/organizations: Automatically retry API calls on ConcurrentModificationException error #9195

Merged
merged 1 commit into from
Jul 8, 2019

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Jul 1, 2019

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" comments, they generate extra noise for pull request followers and do not help prioritize the request

Closes #5073

Release note for CHANGELOG:

* service/organizations: Automatically retry API calls on `ConcurrentModificationException` error

Previous output from the new acceptance testing before migrating the testing to the serialized Organizations testing:

--- FAIL: TestAccAwsOrganizationsPolicy_concurrent (6.73s)
    testing.go:568: Step 0 error: errors during apply:

        Error: error creating Organizations Policy: AWSOrganizationsNotInUseException: Your account is not a member of an organization.

Previous output from the new acceptance testing before adding the service client retry logic:

        --- FAIL: TestAccAWSOrganizations/Policy/concurrent (16.40s)
            testing.go:629: Error destroying resource! WARNING: Dangling resources
                may exist. The full state and error is shown below.

                Error: errors during apply: ConcurrentModificationException: AWS Organizations can't complete your request because it conflicts with another attempt to modify the same entity. Try again later.

Output from acceptance testing:

--- PASS: TestAccAWSOrganizations (246.04s)
    --- PASS: TestAccAWSOrganizations/Organization (87.29s)
        --- PASS: TestAccAWSOrganizations/Organization/AwsServiceAccessPrincipals (25.19s)
        --- PASS: TestAccAWSOrganizations/Organization/EnabledPolicyTypes (33.61s)
        --- PASS: TestAccAWSOrganizations/Organization/FeatureSet (10.42s)
        --- PASS: TestAccAWSOrganizations/Organization/basic (18.07s)
    --- PASS: TestAccAWSOrganizations/Account (0.00s)
        --- SKIP: TestAccAWSOrganizations/Account/basic (0.00s)
            resource_aws_organizations_account_test.go:15: AWS Organizations Account testing is not currently automated due to manual account deletion steps.
        --- SKIP: TestAccAWSOrganizations/Account/ParentId (0.00s)
            resource_aws_organizations_account_test.go:57: AWS Organizations Account testing is not currently automated due to manual account deletion steps.
    --- PASS: TestAccAWSOrganizations/OrganizationalUnit (36.87s)
        --- PASS: TestAccAWSOrganizations/OrganizationalUnit/basic (14.79s)
        --- PASS: TestAccAWSOrganizations/OrganizationalUnit/Name (22.08s)
    --- PASS: TestAccAWSOrganizations/Policy (63.90s)
        --- PASS: TestAccAWSOrganizations/Policy/concurrent (18.56s)
        --- PASS: TestAccAWSOrganizations/Policy/Description (21.93s)
        --- PASS: TestAccAWSOrganizations/Policy/basic (23.41s)
    --- PASS: TestAccAWSOrganizations/PolicyAttachment (57.98s)
        --- PASS: TestAccAWSOrganizations/PolicyAttachment/Account (17.75s)
        --- PASS: TestAccAWSOrganizations/PolicyAttachment/OrganizationalUnit (21.75s)
        --- PASS: TestAccAWSOrganizations/PolicyAttachment/Root (18.48s)
PASS

…ificationException

Reference: #5073

Previous output from the new acceptance testing before migrating the testing to the serialized Organizations testing:

```
--- FAIL: TestAccAwsOrganizationsPolicy_concurrent (6.73s)
    testing.go:568: Step 0 error: errors during apply:

        Error: error creating Organizations Policy: AWSOrganizationsNotInUseException: Your account is not a member of an organization.
```

Previous output from the new acceptance testing before adding the service client retry logic:

```
        --- FAIL: TestAccAWSOrganizations/Policy/concurrent (16.40s)
            testing.go:629: Error destroying resource! WARNING: Dangling resources
                may exist. The full state and error is shown below.

                Error: errors during apply: ConcurrentModificationException: AWS Organizations can't complete your request because it conflicts with another attempt to modify the same entity. Try again later.
```

Output from acceptance testing:

```
--- PASS: TestAccAWSOrganizations (246.04s)
    --- PASS: TestAccAWSOrganizations/Organization (87.29s)
        --- PASS: TestAccAWSOrganizations/Organization/AwsServiceAccessPrincipals (25.19s)
        --- PASS: TestAccAWSOrganizations/Organization/EnabledPolicyTypes (33.61s)
        --- PASS: TestAccAWSOrganizations/Organization/FeatureSet (10.42s)
        --- PASS: TestAccAWSOrganizations/Organization/basic (18.07s)
    --- PASS: TestAccAWSOrganizations/Account (0.00s)
        --- SKIP: TestAccAWSOrganizations/Account/basic (0.00s)
            resource_aws_organizations_account_test.go:15: AWS Organizations Account testing is not currently automated due to manual account deletion steps.
        --- SKIP: TestAccAWSOrganizations/Account/ParentId (0.00s)
            resource_aws_organizations_account_test.go:57: AWS Organizations Account testing is not currently automated due to manual account deletion steps.
    --- PASS: TestAccAWSOrganizations/OrganizationalUnit (36.87s)
        --- PASS: TestAccAWSOrganizations/OrganizationalUnit/basic (14.79s)
        --- PASS: TestAccAWSOrganizations/OrganizationalUnit/Name (22.08s)
    --- PASS: TestAccAWSOrganizations/Policy (63.90s)
        --- PASS: TestAccAWSOrganizations/Policy/concurrent (18.56s)
        --- PASS: TestAccAWSOrganizations/Policy/Description (21.93s)
        --- PASS: TestAccAWSOrganizations/Policy/basic (23.41s)
    --- PASS: TestAccAWSOrganizations/PolicyAttachment (57.98s)
        --- PASS: TestAccAWSOrganizations/PolicyAttachment/Account (17.75s)
        --- PASS: TestAccAWSOrganizations/PolicyAttachment/OrganizationalUnit (21.75s)
        --- PASS: TestAccAWSOrganizations/PolicyAttachment/Root (18.48s)
PASS
```
@bflad bflad added bug Addresses a defect in current functionality. service/organizations Issues and PRs that pertain to the organizations service. labels Jul 1, 2019
@bflad bflad requested a review from a team July 1, 2019 23:57
@ghost ghost added size/M Managed by automation to categorize the size of a PR. provider Pertains to the provider itself, rather than any interaction with AWS. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Jul 1, 2019
Copy link
Contributor

@nywilken nywilken left a comment

Choose a reason for hiding this comment

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

LGTM 👍 👍

@bflad bflad added this to the v2.19.0 milestone Jul 8, 2019
@bflad bflad merged commit 153ac38 into master Jul 8, 2019
@bflad bflad deleted the b-organizations-ConcurrentModificationException branch July 8, 2019 22:29
bflad added a commit that referenced this pull request Jul 8, 2019
@bflad
Copy link
Contributor Author

bflad commented Jul 11, 2019

This has been released in version 2.19.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!

@ghost
Copy link

ghost commented Nov 2, 2019

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 and limited conversation to collaborators Nov 2, 2019
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. provider Pertains to the provider itself, rather than any interaction with AWS. service/organizations Issues and PRs that pertain to the organizations 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
2 participants