Ravi Nori has uploaded a new change for review.

Change subject: engine : placeholders of child commands aren't cleared on 
exception
......................................................................

engine : placeholders of child commands aren't cleared on exception

When one of the child commands fails or throws
a VdcBllException if not all child commands
are executed clearAsyncTasksWithOutVdsmId is
not being invoked.

On VdcBllException we need to invoke method
clearAsyncTasksWithOutVdsmId on all child
commands to clear the place holder of commands
that have not been executed.

Change-Id: I457a1f9357fda9232a8757984d6936d9c977aa62
Bug-Url: https://bugzilla.redhat.com/1126204
Signed-off-by: Ravi Nori <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
1 file changed, 11 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/52/31352/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 cf29108..4a35a3b 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
@@ -353,6 +353,13 @@
         return getReturnValue();
     }
 
+    private void clearChildAsyncTasksWithOutVdsmId() {
+        for (Entry<Guid, CommandBase<?>> entry : childCommandsMap.entrySet()) {
+            entry.getValue().clearAsyncTasksWithOutVdsmId();
+            entry.getValue().clearChildAsyncTasksWithOutVdsmId();
+        }
+    }
+
     private void clearAsyncTasksWithOutVdsmId() {
         if (!getReturnValue().getTaskPlaceHolderIdList().isEmpty()) {
             TransactionSupport.executeInNewTransaction(new 
TransactionMethod<Void>() {
@@ -1176,6 +1183,7 @@
         } finally {
             // If we failed to execute due to exception or some other reason, 
we compensate for the failure.
             if (exceptionOccurred || !getSucceeded()) {
+                clearChildAsyncTasksWithOutVdsmId();
                 setCommandStatus(CommandStatus.FAILED);
                 setSucceeded(false);
                 compensate();
@@ -1358,6 +1366,9 @@
                                     
BackendUtils.getBackendCommandObjectsHandler(log).createAction(entry.getValue().getFirst(),
                                             entry.getValue().getSecond(),
                                             context);
+                            log.infoFormat("Command {0} persisting async task 
placeholder for child command {1}",
+                                    getCommandId(),
+                                    command.getCommandId());
                             command.insertAsyncTaskPlaceHolders();
                             childCommandsMap.put(entry.getKey(), command);
                         }


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I457a1f9357fda9232a8757984d6936d9c977aa62
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.5
Gerrit-Owner: Ravi Nori <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to