Federico Simoncelli has posted comments on this change.
Change subject: backend: unlock imported glance image on create errors
......................................................................
Patch Set 1:
(2 comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportRepoImageCreateTaskHandler.java
Line 106: public void endWithFailure() {
Line 107:
enclosingCommand.getParameters().getDiskImage().setImageStatus(ImageStatus.ILLEGAL);
Line 108: ImagesHandler.updateImageStatus(
Line 109:
enclosingCommand.getParameters().getDiskImage().getImageId(),
Line 110:
enclosingCommand.getParameters().getDiskImage().getImageStatus());
I think along the way there's a check on the disk status (LOCKED at this point)
that would prevent RemoveDisk from being executed.
Line 111: compensate();
Line 112: enclosingCommand.getReturnValue().setSucceeded(true);
Line 113: }
Line 114:
Line 107:
enclosingCommand.getParameters().getDiskImage().setImageStatus(ImageStatus.ILLEGAL);
Line 108: ImagesHandler.updateImageStatus(
Line 109:
enclosingCommand.getParameters().getDiskImage().getImageId(),
Line 110:
enclosingCommand.getParameters().getDiskImage().getImageStatus());
Line 111: compensate();
As far as I remember (I'm not going to check now) RemoveDisk handles the entire
flow: it tries to delete the image in the storage (but if it's missing it
swallows the error), and it removes the entry from the db. If I use
RemoveImageCommand I'd have to reimplement all this.
Line 112: enclosingCommand.getReturnValue().setSucceeded(true);
Line 113: }
Line 114:
Line 115: @Override
--
To view, visit http://gerrit.ovirt.org/19371
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I49054d36eef780d0902f7dcd448ca44797f42916
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Sergey Gotliv <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches