Skip to content

Commit

Permalink
fix: account creation lock issue
Browse files Browse the repository at this point in the history
  • Loading branch information
andyzhangx committed Jan 10, 2021
1 parent a9db67c commit bc99fa0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/azurefile/controllerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,6 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
if len(req.GetSecrets()) == 0 && accountName == "" {
lockKey := sku + accountKind + resourceGroup + location
d.volLockMap.LockEntry(lockKey)
defer d.volLockMap.UnlockEntry(lockKey)

err = wait.ExponentialBackoff(d.cloud.RequestBackoff(), func() (bool, error) {
var retErr error
accountName, accountKey, retErr = d.cloud.EnsureStorageAccount(accountOptions, fileShareAccountNamePrefix)
Expand All @@ -221,6 +219,7 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
}
return true, retErr
})
d.volLockMap.UnlockEntry(lockKey)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to ensure storage account: %v", err)
}
Expand Down

0 comments on commit bc99fa0

Please sign in to comment.