Ravi Nori has uploaded a new change for review.

Change subject: engine : execute flag should set when no exception occurs
......................................................................

engine : execute flag should set when no exception occurs

setCommandExecuted should be called only when  no
exceptions are thrown during the command execution

Change-Id: I090fec2f55893c799164e01ec36c727c8244cab4
Bug-Url: https://bugzilla.redhat.com/1129885
Signed-off-by: Ravi Nori <rn...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/39/31539/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
index 19cdb3e..360254f 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
@@ -1181,6 +1181,9 @@
             processExceptionToClient(new VdcFault(e, VdcBllErrors.ENGINE));
             log.error(String.format("Command %1$s throw exception", 
getClass().getName()), e);
         } finally {
+            if (!exceptionOccurred) {
+                setCommandExecuted();
+            }
             // If we failed to execute due to exception or some other reason, 
we compensate for the failure.
             if (exceptionOccurred || !getSucceeded()) {
                 clearChildAsyncTasksWithOutVdsmId();
@@ -1320,7 +1323,6 @@
             // Transaction was aborted - we must sure we compensation for all 
previous applicative stages of the command
             compensate();
         } finally {
-            setCommandExecuted();
             try {
                 if (getCommandShouldBeLogged()) {
                     logRenamedEntity();


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I090fec2f55893c799164e01ec36c727c8244cab4
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.5
Gerrit-Owner: Ravi Nori <rn...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to