Arik Hadas has posted comments on this change.
Change subject: engine: Re-run vm on other host if vm creation fail
......................................................................
Patch Set 1: (2 inline comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java
Line 205: VdcBllErrors errorCode = e.getErrorCode();
Line 206:
Line 207: // if the returned exception is such that shoudn't
trigger the re-run process,
Line 208: // re-throw it. otherwise, continue (the vm will be
down and a re-run will be triggered)
Line 209: switch (errorCode) {
you're right, if the operation is Done there won't be exception thrown in any
flow I saw. I thought about it that way: "on which errors we will not want to
rerun a vm that we didn't manage to create?". currently the answer is probably
if it exists or if the operation was ok (we can add more error codes later on
demand).
so basically it's a "defensive code" - the code is protecting itself from a
value (Done) that shouldn't be received (and currently can't be received..)
I think it's wrong to set the operation to successful in that case as if it
really was successful, no exception with "Done" code should be thrown
Line 210: case Done:
Line 211: case exist:
Line 212: throw e;
Line 213: default:
Line 205: VdcBllErrors errorCode = e.getErrorCode();
Line 206:
Line 207: // if the returned exception is such that shoudn't
trigger the re-run process,
Line 208: // re-throw it. otherwise, continue (the vm will be
down and a re-run will be triggered)
Line 209: switch (errorCode) {
I agree, but I think it shouldn't be specific to this portion of code - we'll
need to consider changing that flow which is based on throwing exception all
around..
Line 210: case Done:
Line 211: case exist:
Line 212: throw e;
Line 213: default:
--
To view, visit http://gerrit.ovirt.org/9085
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I35569a2ebfbea3e8eb69b414c31748c49cb29841
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Arik Hadas <[email protected]>
Gerrit-Reviewer: Arik Hadas <[email protected]>
Gerrit-Reviewer: Liron Aravot <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Sharad Mishra <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches