You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ah...@apache.org on 2013/01/19 01:00:13 UTC

[29/51] [abbrv] git commit: CLOUDSTACK-803: HA gets triggered even when the host investigator is unable to determine the state of the host HA won't be triggered in case the host investigator is not able to determine the state

CLOUDSTACK-803: HA gets triggered even when the host investigator is unable to determine the state of the host HA won't be triggered in case the host investigator is not able to determine the state

Signed-off-by: Koushik Das <ko...@citrix.com>
Signed-off-by: Abhinandan Prateek <ap...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/e45a9f3a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/e45a9f3a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/e45a9f3a

Branch: refs/heads/javelin
Commit: e45a9f3aed3f3ad2295848f2475a4a1ec478ee81
Parents: 070856a
Author: Koushik Das <ko...@citrix.com>
Authored: Mon Jan 7 11:06:54 2013 +0530
Committer: Abhinandan Prateek <ap...@apache.org>
Committed: Fri Jan 18 17:20:51 2013 +0530

----------------------------------------------------------------------
 .../com/cloud/agent/manager/AgentManagerImpl.java  |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e45a9f3a/server/src/com/cloud/agent/manager/AgentManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/agent/manager/AgentManagerImpl.java b/server/src/com/cloud/agent/manager/AgentManagerImpl.java
index 8b3ee6b..fd5b3bd 100755
--- a/server/src/com/cloud/agent/manager/AgentManagerImpl.java
+++ b/server/src/com/cloud/agent/manager/AgentManagerImpl.java
@@ -918,10 +918,16 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory, Manager {
                 s_logger.info("Investigating why host " + hostId + " has disconnected with event " + event);
 
                 final Status determinedState = investigate(attache);
+                // if state cannot be determined do nothing and bail out
+                if (determinedState == null) {
+                    s_logger.warn("Agent state cannot be determined, do nothing");
+                    return false;
+                }
+
                 final Status currentStatus = host.getStatus();
                 s_logger.info("The state determined is " + determinedState);
 
-                if (determinedState == null || determinedState == Status.Down) {
+                if (determinedState == Status.Down) {
                     s_logger.error("Host is down: " + host.getId() + "-" + host.getName() + ".  Starting HA on the VMs");
                     event = Status.Event.HostDown;
                 } else if (determinedState == Status.Up) {