Skip to content

Commit 1f73b73

Browse files
committed
fix: account creation lock issue
1 parent e402932 commit 1f73b73

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pkg/blob/controllerserver.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,6 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
137137
if len(req.GetSecrets()) == 0 && accountName == "" {
138138
lockKey := storageAccountType + accountKind + resourceGroup + location
139139
d.volLockMap.LockEntry(lockKey)
140-
defer d.volLockMap.UnlockEntry(lockKey)
141-
142140
err = wait.ExponentialBackoff(d.cloud.RequestBackoff(), func() (bool, error) {
143141
var retErr error
144142
accountName, accountKey, retErr = d.cloud.EnsureStorageAccount(accountOptions, protocol)
@@ -148,6 +146,7 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
148146
}
149147
return true, retErr
150148
})
149+
d.volLockMap.UnlockEntry(lockKey)
151150
if err != nil {
152151
return nil, status.Errorf(codes.Internal, "failed to ensure storage account: %v", err)
153152
}

0 commit comments

Comments
 (0)