Moti Asayag has posted comments on this change.

Change subject: engine: Add Upgrade host command
......................................................................


Patch Set 2:

(1 comment)

https://gerrit.ovirt.org/#/c/40462/2/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/host/HostUpgradeCallback.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/host/HostUpgradeCallback.java:

Line 45:                     
CommandCoordinatorUtil.executeAsyncCommand(VdcActionType.UpgradeHostInternal,
Line 46:                             parameters,
Line 47:                             command.cloneContextAndDetachFromParent());
Line 48:             try {
Line 49:                 VdcReturnValueBase result = upgradeCmd.get();
> according to the javado of Future.get: "Waits if necessary for the computat
Maybe I overlooked at this issue. Please confirm the following assumptions:

Invoking an async command from a callback can be monitored by 2 options:

1. Storing the Future<ReturnValue> object returned by 
CommandCoordinatorUtil.executeAsyncCommand() as an instance member of the 
callback, and each doPolling() invocation check its completion status.

2. provide CommandCoordinatorUtil.executeAsyncCommand() the required parent 
command parameters, so the invoked command will be considered as a child 
command of the existing command, and query for its status.

Both options are valid, just they represents different stages of the overall 
flow in the same method which is less readable/maintainable. 

There is another option to block on that action (running with 
Backend.runInternalAction()). The downside is that if the engine crashes during 
that command, the doPolling() will probably attempt to execute this command 
again once the engine is up.

What is the preferred method ?
Line 50:                 command.setCommandStatus(result.getSucceeded() ? 
CommandStatus.SUCCEEDED : CommandStatus.FAILED);
Line 51:             } catch (Exception e) {
Line 52:                 command.setCommandStatus(CommandStatus.FAILED);
Line 53:             }


-- 
To view, visit https://gerrit.ovirt.org/40462
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I1a1447f3ebb5a7e3a67a8c68d449ae61e29f97fc
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Moti Asayag <masa...@redhat.com>
Gerrit-Reviewer: Daniel Erez <de...@redhat.com>
Gerrit-Reviewer: Eli Mesika <emes...@redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Moti Asayag <masa...@redhat.com>
Gerrit-Reviewer: Ravi Nori <rn...@redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybron...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to