Liron Ar has posted comments on this change.

Change subject: core: added GetAllDiskSnapshotsByStorageDomainIdQuery
......................................................................


Patch Set 5:

(1 comment)

http://gerrit.ovirt.org/#/c/26323/5/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetAllDiskSnapshotsByStorageDomainIdQuery.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetAllDiskSnapshotsByStorageDomainIdQuery.java:

Line 36: 
Line 37:         for (final DiskImage diskImage : diskImages) {
Line 38:             Snapshot snapshot = 
snapshots.get(diskImage.getVmSnapshotId());
Line 39:             // Verify snapshot is not null to mitigate possible race 
conditions
Line 40:             if (snapshot != null) {
i referred to it in the last review iteration and it possibly was missed :) but 
we have potential race here - for example, if this query runs while a snapshot 
is being deleted we might return diskImages with non existing 
VmSnapshotDescription (as "snapshot" would be null).

I suggest to do the following: 
1. add a list to return -

List<DiskImage> toReturn = new..

2. remove the select statement in line 26

3. add here to toReturn list when snapshot!=null so we have the 
vmsnapshotdescription
Line 41:                 
diskImage.setVmSnapshotDescription(snapshot.getDescription());
Line 42:             }
Line 43:         }
Line 44: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I389579e4120cb33edca594caa762a8bad63362b7
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Daniel Erez <de...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Daniel Erez <de...@redhat.com>
Gerrit-Reviewer: Liron Ar <lara...@redhat.com>
Gerrit-Reviewer: Maor Lipchuk <mlipc...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to