From 4c93e42d226211131e5e837b99c609a453cae003 Mon Sep 17 00:00:00 2001 From: nitzanm <345917+nitzanm@users.noreply.github.com> Date: Sat, 5 Oct 2019 00:09:00 -0700 Subject: [PATCH] =?UTF-8?q?azurerm=5Fnetwork=5Fsecurity=5Fgroup=5Fassociat?= =?UTF-8?q?ion=20-=20prevent=20deadlock=20b=E2=80=A6=20(#4501)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix a deadlock between network_security_group_association and network_interface, caused by them locking the same resources, but in a different order. * Removed extra linebreak. --- ...esource_arm_subnet_network_security_group_association.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azurerm/resource_arm_subnet_network_security_group_association.go b/azurerm/resource_arm_subnet_network_security_group_association.go index c093b0d2882b..3aeb197873d5 100644 --- a/azurerm/resource_arm_subnet_network_security_group_association.go +++ b/azurerm/resource_arm_subnet_network_security_group_association.go @@ -67,12 +67,12 @@ func resourceArmSubnetNetworkSecurityGroupAssociationCreate(d *schema.ResourceDa virtualNetworkName := parsedSubnetId.Path["virtualNetworks"] resourceGroup := parsedSubnetId.ResourceGroup - locks.ByName(virtualNetworkName, virtualNetworkResourceName) - defer locks.UnlockByName(virtualNetworkName, virtualNetworkResourceName) - locks.ByName(subnetName, subnetResourceName) defer locks.UnlockByName(subnetName, subnetResourceName) + locks.ByName(virtualNetworkName, virtualNetworkResourceName) + defer locks.UnlockByName(virtualNetworkName, virtualNetworkResourceName) + subnet, err := client.Get(ctx, resourceGroup, virtualNetworkName, subnetName, "") if err != nil { if utils.ResponseWasNotFound(subnet.Response) {