Skip to content

Commit

Permalink
Merge pull request kubernetes-sigs#524 from kubernetes-sigs/lock-issue
Browse files Browse the repository at this point in the history
fix: account creation lock issue
  • Loading branch information
andyzhangx authored Jan 11, 2021
2 parents 0474e87 + bc99fa0 commit 3b2295f
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 3b2295f

Please sign in to comment.