Eli Mesika has uploaded a new change for review.

Change subject: core: use last successful proxy in wait-for-status
......................................................................

core: use last successful proxy in wait-for-status

Power Management proxy selection keep selecting the same proxy first
even is it constantly fails

This patch changes the waiting for status after stop/start PM action to
use the last successful proxy along the wait-for-status loop instead of
searching for proxy each time that might be resulted in significant
delays in case that the preferred proxy (according to the proxy selection
settings_ has some connectivity issues and can not access the PM card.

Change-Id: I7684826be6098e952134366ce480ddb1ca3a2c99
Signed-off-by: Eli Mesika <emes...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceVdsBaseCommand.java
1 file changed, 26 insertions(+), 25 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/90/32890/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceVdsBaseCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceVdsBaseCommand.java
index b3ba179..41463cf 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceVdsBaseCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceVdsBaseCommand.java
@@ -520,33 +520,34 @@
         // in most cases it will not turn from on/off to off/on and we will 
need
         // to wait a full cycle for it.
         ThreadUtils.sleep(getSleep(actionType, order));
-        while (!statusReached && i <= getRerties()) {
-            log.infoFormat("Attempt {0} to get vds {1} status", i, vdsName);
-            if (executor.findProxyHost()) {
-                VDSReturnValue returnValue = executor.fence(order);
-                if (returnValue != null && returnValue.getReturnValue() != 
null) {
-                    FenceStatusReturnValue value = (FenceStatusReturnValue) 
returnValue.getReturnValue();
-                    if (value.getStatus().equalsIgnoreCase("unknown")) {
-                        // No need to retry , agent definitions are corrupted
-                        log.warnFormat("Host {0} {1} PM Agent definitions are 
corrupted, Waiting for Host to {2} aborted.", vdsName, order.name(), 
actionType.name());
+        // get a proxy host to be used along the whole wait-for-status loop in 
order to prevent unnecessary delays when
+        // a potential preferred proxy host has connectivity problems and can 
not access the fenced host PM card
+        if (executor.findProxyHost()) {
+            while (!statusReached && i <= getRerties()) {
+                log.infoFormat("Attempt {0} to get vds {1} status", i, 
vdsName);
+
+                    VDSReturnValue returnValue = executor.fence(order);
+                    if (returnValue != null && returnValue.getReturnValue() != 
null) {
+                        FenceStatusReturnValue value = 
(FenceStatusReturnValue) returnValue.getReturnValue();
+                        if (value.getStatus().equalsIgnoreCase("unknown")) {
+                            // No need to retry , agent definitions are 
corrupted
+                            log.warnFormat("Host {0} {1} PM Agent definitions 
are corrupted, Waiting for Host to {2} aborted.", vdsName, order.name(), 
actionType.name());
+                            break;
+                        }
+                        else {
+                            if (FENCE_CMD.equalsIgnoreCase(value.getStatus())) 
{
+                                statusReached = true;
+                                log.infoFormat("vds {0} status is {1}", 
vdsName, FENCE_CMD);
+                            } else {
+                                i++;
+                                if (i <= getRerties())
+                                    ThreadUtils.sleep(getDelayInSeconds() * 
1000);
+                            }
+                        }
+                    } else {
+                        log.errorFormat("Failed to get host {0} status.", 
vdsName);
                         break;
                     }
-                    else {
-                        if (FENCE_CMD.equalsIgnoreCase(value.getStatus())) {
-                            statusReached = true;
-                            log.infoFormat("vds {0} status is {1}", vdsName, 
FENCE_CMD);
-                        } else {
-                            i++;
-                            if (i <= getRerties())
-                                ThreadUtils.sleep(getDelayInSeconds() * 1000);
-                        }
-                    }
-                } else {
-                    log.errorFormat("Failed to get host {0} status.", vdsName);
-                    break;
-                }
-            } else {
-                break;
             }
         }
         if (!statusReached) {


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

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

Reply via email to