Skip to content

Commit

Permalink
fix potential lock issue
Browse files Browse the repository at this point in the history
  • Loading branch information
marwanad committed Jul 9, 2020
1 parent 5a9de63 commit d409a7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cluster-autoscaler/cloudprovider/azure/azure_scale_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,11 +435,11 @@ func (scaleSet *ScaleSet) DeleteInstances(instances []*azureRef) error {
scaleSet.instanceMutex.Lock()
klog.V(3).Infof("Calling virtualMachineScaleSetsClient.DeleteInstancesAsync(%v)", requiredIds.InstanceIds)
future, rerr := scaleSet.manager.azClient.virtualMachineScaleSetsClient.DeleteInstancesAsync(ctx, resourceGroup, commonAsg.Id(), *requiredIds)
scaleSet.instanceMutex.Unlock()
if rerr != nil {
klog.Errorf("virtualMachineScaleSetsClient.DeleteInstancesAsync for instances %v failed: %v", requiredIds.InstanceIds, rerr)
return rerr.Error()
}
scaleSet.instanceMutex.Unlock()

// Proactively decrement scale set size so that we don't
// go below minimum node count if cache data is stale
Expand Down

0 comments on commit d409a7f

Please sign in to comment.