Michael Kublin has uploaded a new change for review.

Change subject: engine: Fixing update of host status during restart host
......................................................................

engine: Fixing update of host status during restart host

If we failed during restart a host status should be switched to NonResponsive,
the status was switched at roollback() nethod, but because of command is 
NonTransactive
a rollback will be never called, so moving an update of status to execute

Change-Id: I1d44a3ee76e2dc2490f8cf937a768c80826af46c
Signed-off-by: Michael Kublin <mkub...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RestartVdsCommand.java
1 file changed, 7 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/95/13895/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RestartVdsCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RestartVdsCommand.java
index 1129165..e2b0b02 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RestartVdsCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RestartVdsCommand.java
@@ -60,6 +60,13 @@
         } else {
             setSucceeded(false);
         }
+        if (!getSucceeded()) {
+            log.warnFormat("Restart host action failed, updating host {0} to 
{1}",
+                    vdsId,
+                    VDSStatus.NonResponsive.name());
+            runVdsCommand(VDSCommandType.SetVdsStatus, new 
SetVdsStatusVDSCommandParameters(vdsId,
+                    VDSStatus.NonResponsive));
+        }
     }
 
     private void executeFenceVdsManuallyAction(final Guid vdsId, String 
sessionId) {
@@ -80,17 +87,6 @@
         params.setParentCommand(VdcActionType.RestartVds);
         params.setSessionId(sessionId);
         return Backend.getInstance().runInternalAction(action, params);
-    }
-
-    /**
-     * If failed to restart the host, move its status to NonResponsive
-     */
-    @Override
-    public void rollback() {
-        super.rollback();
-        final Guid vdsId = getVdsId();
-        log.warnFormat("Restart host action failed, updating host {0} to {1}", 
vdsId, VDSStatus.NonResponsive.name());
-        runVdsCommand(VDSCommandType.SetVdsStatus, new 
SetVdsStatusVDSCommandParameters(vdsId, VDSStatus.NonResponsive));
     }
 
     @Override


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1d44a3ee76e2dc2490f8cf937a768c80826af46c
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Michael Kublin <mkub...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to