mirror of https://github.com/apache/cloudstack.git
bug 10511: lock on snapshot entry instead of volume entry
status 10511: resolved fixed
This commit is contained in:
parent
446d08187b
commit
43de3ec249
|
|
@ -658,7 +658,7 @@ public class StorageManagerImpl implements StorageManager, StorageService, Manag
|
|||
|
||||
String basicErrMsg = "Failed to create volume from " + snapshot.getName();
|
||||
CreateVolumeFromSnapshotAnswer answer;
|
||||
if (!_volsDao.lockInLockTable(volumeId.toString(), 10)) {
|
||||
if (!_snapshotDao.lockInLockTable(snapshotId.toString(), 10)) {
|
||||
throw new CloudRuntimeException("failed to create volume from " + snapshotId + " due to original volume:" + volumeId + " is being used, try it later ");
|
||||
}
|
||||
try {
|
||||
|
|
@ -671,7 +671,7 @@ public class StorageManagerImpl implements StorageManager, StorageService, Manag
|
|||
} catch (StorageUnavailableException e) {
|
||||
s_logger.error(basicErrMsg);
|
||||
} finally {
|
||||
_volsDao.unlockFromLockTable(volumeId.toString());
|
||||
_snapshotDao.unlockFromLockTable(snapshotId.toString());
|
||||
}
|
||||
return new Pair<String, String>(vdiUUID, basicErrMsg);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue