You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2015/04/29 15:00:49 UTC

[1/2] git commit: updated refs/heads/master to 97e4fbc

Repository: cloudstack
Updated Branches:
  refs/heads/master 1669bb98a -> 97e4fbc29


return a state instead of null

When a full cluster is down or unreachable,
CloudStack currently reports everything the
same as the last known state, which is usually
Up. When it cannot reach a host and cannot
reach another host in the same cluster either,
it returns null and says "I don't know". This
prevents it from reporting the problem. Now,
we return an Alert or Disconnected state so
proper action can be taken.

Also logging was added, so we know what part
of the code put it to Alert or Disconnected.


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

Branch: refs/heads/master
Commit: 78e095e64b2344a49e96a7939ca6edd3b36d93dd
Parents: 229f238
Author: Remi Bergsma <gi...@remi.nl>
Authored: Wed Apr 29 14:14:14 2015 -0400
Committer: Remi Bergsma <gi...@remi.nl>
Committed: Wed Apr 29 08:09:20 2015 -0400

----------------------------------------------------------------------
 .../src/com/cloud/ha/AbstractInvestigatorImpl.java  | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/78e095e6/server/src/com/cloud/ha/AbstractInvestigatorImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/ha/AbstractInvestigatorImpl.java b/server/src/com/cloud/ha/AbstractInvestigatorImpl.java
index bb37c05..b222386 100644
--- a/server/src/com/cloud/ha/AbstractInvestigatorImpl.java
+++ b/server/src/com/cloud/ha/AbstractInvestigatorImpl.java
@@ -92,7 +92,7 @@ public abstract class AbstractInvestigatorImpl extends AdapterBase implements In
                 if (s_logger.isDebugEnabled()) {
                     s_logger.debug("host (" + testHostIp + ") returns null answer");
                 }
-                return null;
+                return Status.Alert;
             }
 
             if (pingTestAnswer.getResult()) {
@@ -103,14 +103,20 @@ public abstract class AbstractInvestigatorImpl extends AdapterBase implements In
                 return Status.Up;
             } else {
                 if (s_logger.isDebugEnabled()) {
-                    s_logger.debug("host (" + testHostIp + ") cannot be pinged, returning null ('I don't know')");
+                    s_logger.debug("host (" + testHostIp + ") cannot be pinged, returning Alert state");
                 }
-                return null;
+                return Status.Alert;
             }
         } catch (AgentUnavailableException e) {
-            return null;
+            if (s_logger.isDebugEnabled()) {
+                s_logger.debug("host (" + testHostIp + "): " + e.getLocalizedMessage() + ", returning Disconnected state");
+            }
+            return Status.Disconnected;
         } catch (OperationTimedoutException e) {
-            return null;
+            if (s_logger.isDebugEnabled()) {
+                s_logger.debug("host (" + testHostIp + "): " + e.getLocalizedMessage() + ", returning Alert state");
+            }
+            return Status.Alert;
         }
     }
 }


[2/2] git commit: updated refs/heads/master to 97e4fbc

Posted by da...@apache.org.
Merge branch 'investigator_null_state_fix' of https://github.com/remibergsma/cloudstack

    This closes #211


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

Branch: refs/heads/master
Commit: 97e4fbc294e1594be97596e0c1a57e3195e6f31f
Parents: 1669bb9 78e095e
Author: Daan Hoogland <dh...@schubergphilis.com>
Authored: Wed Apr 29 15:00:00 2015 +0200
Committer: Daan Hoogland <dh...@schubergphilis.com>
Committed: Wed Apr 29 15:00:00 2015 +0200

----------------------------------------------------------------------
 .../src/com/cloud/ha/AbstractInvestigatorImpl.java  | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------