Michael Kublin has posted comments on this change.

Change subject: core: WIP : RemoveImageDisk - race when updating snapshots ovf 
(#828192)
......................................................................


Patch Set 14: (4 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveImageCommand.java
Line 99:                 getCommandId()));
Line 100:         p.setEntityId(getParameters().getEntityId());
Line 101:         return 
AsyncTaskManager.getInstance().CreateTask(AsyncTaskType.deleteImage, p);
Line 102:     }
Line 103: 
??? Yes and that's why we should not acquire any lock, what is relation to 
other patch?
Line 104:     private void removeImageFromDB() {
Line 105:         final DiskImage diskImage = getDiskImage();
Line 106:         final List<Snapshot> updatedSnapshots;
Line 107:         final boolean shouldPerformOpOnVmSnapshots = 
!diskImage.isShareable();


Line 110:             if (shouldPerformOpOnVmSnapshots) {
Line 111:                 VM vm = getVmForNonShareableDiskImage(diskImage);
Line 112:                 lockVmSnapshotsWithWait(vm);
Line 113:                 updatedSnapshots = 
prepareSnapshotConfigWithoutImage(diskImage.getId());
Line 114:             } else {
Which patch, now u are writing some code that possible is based on bug?
Line 115:                 updatedSnapshots = Collections.emptyList();
Line 116:             }
Line 117: 
Line 118:             
TransactionSupport.executeInScope(TransactionScopeOption.Required,


Line 157:                 freeVmSnapshotsLock();
Line 158:             }
Line 159:         }
Line 160:     }
Line 161: 
Check that it is not null, instead of creating an EmptyLock and after that in 
case of failure u will try to release an empty lock?
Line 162:     private final EngineLock snapshotsEngineLock = new EngineLock();
Line 163: 
Line 164:     private void lockVmSnapshotsWithWait(VM vm) {
Line 165:         Map<String, String> snapshotsExlusiveLockMap = 
Collections.singletonMap(vm.getId().toString(), 
LockingGroup.VM_SNAPSHOTS.name());


Line 165:         Map<String, String> snapshotsExlusiveLockMap = 
Collections.singletonMap(vm.getId().toString(), 
LockingGroup.VM_SNAPSHOTS.name());
Line 166:         
snapshotsEngineLock.setExclusiveLocks(snapshotsExlusiveLockMap);
Line 167:         getLockManager().acquireLockWait(snapshotsEngineLock);
Line 168:     }
Line 169: 
so, I suppose instead of String s = new String(), you also is writing something 
like that:
private String makeNewString() {
     return new String();
}

also more readable?
Also what can bi simple that one line code? And what is not clear at 
getLockManager().releaseLock(snapshotsEngineLock); that I need a special method?
Line 170:     private void freeVmSnapshotsLock(){
Line 171:         getLockManager().releaseLock(snapshotsEngineLock);
Line 172:      }
Line 173: 


--
To view, visit http://gerrit.ovirt.org/7482
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iccb44f1aa9d204477955343167133849a4146753
Gerrit-PatchSet: 14
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Liron Aravot <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Ayal Baron <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Liron Aravot <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Michael Kublin <[email protected]>
Gerrit-Reviewer: Tal Nisan <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to