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

azurerm_express_route_port_authorization: add a lock when create/update/delete authorization of express route port #21959

Merged
merged 2 commits into from
Jun 1, 2023

Conversation

wuxu92
Copy link
Contributor

@wuxu92 wuxu92 commented May 30, 2023

The API permits only one create/update/delete operation on the same express route port resource. Or the API will reponse error as below. this was found in the failure of AccTest TestAccExpressRoutePortAuthorization_multiple

Error: deleting Express Route Port Authorization: (Authorization Name "acctestauth1230529023842741531" / Express Route Port Name "acctestERP-230529023842741531" / Resource Group "acctestRG-230529023842741531"): 
network.ExpressRoutePortAuthorizationsClient#Delete: Failure sending request: StatusCode=0 -- 
Original Error: autorest/azure: Service returned an error. Status=<nil> Code="AnotherOperationInProgress" Message="Another operation on this or dependent resource is in progress. To retrieve status of the operation use uri: 
https://management.azure.com/subscriptions/*******/providers/Microsoft.Network/locations/eastus2/operations/2c22b9e6-04c1-4b53-b5b3-4f6513d2ccd6?api-version=2022-07-01." Details=[]

AccTest Result:

=== RUN   TestAccExpressRoutePortAuthorization_multiple
--- PASS: TestAccExpressRoutePortAuthorization_multiple (262.05s)
PASS

Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

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

Should we also lock azurerm_express_route_port during Create/Update/Delete?

@wuxu92
Copy link
Contributor Author

wuxu92 commented May 31, 2023

@mbfrahry azurerm_express_route_port does not need a lock when tested in my local machine.

Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

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

Right, but we could get into a scenario where we run into issues because we didn't lock the parent resource. It's rare to cause issues but whenever we lock a parent resource in a child resource, we should also lock the parent resource.

Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

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

LGTM!

@mbfrahry mbfrahry added this to the v3.59.0 milestone Jun 1, 2023
@mbfrahry
Copy link
Member

mbfrahry commented Jun 1, 2023

Thanks for adding that lock @wuxu92

@mbfrahry mbfrahry merged commit 506445c into hashicorp:main Jun 1, 2023
13 checks passed
mbfrahry added a commit that referenced this pull request Jun 1, 2023
@wuxu92 wuxu92 deleted the acc/exprouteauth branch June 2, 2023 02:07
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 contributions.
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 May 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants