Skip to content

Commit

Permalink
Caches should be updated after async PUT succeeds
Browse files Browse the repository at this point in the history
  • Loading branch information
feiskyer committed Apr 6, 2020
1 parent 1fb87b1 commit 3f617a1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cluster-autoscaler/cloudprovider/azure/azure_scale_set.go
Expand Up @@ -275,10 +275,6 @@ func (scaleSet *ScaleSet) SetScaleSetSize(size int64) error {
return fmt.Errorf("VMSS %q is still under updating", scaleSet.Name)
}

// Proactively set the VMSS size so autoscaler makes better decisions.
scaleSet.curSize = size
scaleSet.lastSizeRefresh = time.Now()

// Update the new capacity to cache.
vmssSizeMutex.Lock()
vmssInfo.Sku.Capacity = &size
Expand All @@ -300,6 +296,10 @@ func (scaleSet *ScaleSet) SetScaleSetSize(size int64) error {
return rerr.Error()
}

// Proactively set the VMSS size so autoscaler makes better decisions.
scaleSet.curSize = size
scaleSet.lastSizeRefresh = time.Now()

klog.V(3).Infof("create a goroutine to wait for the result of the virtualMachineScaleSetsClient.CreateOrUpdate request")
go scaleSet.updateVMSSCapacity(future)

Expand Down

0 comments on commit 3f617a1

Please sign in to comment.