You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 090db05
Browse filesBrowse the repository at this point in the historyBrowse files
CLOUDSTACK-8666: Put host in Alert state only after alert.wait timeout
Instead of putting the host to Alert state immediately, the investigators should be allowed to run for some time based on alert.wait global config.
At the end of this interval if the host state still cannot be determined then put the host in Alert. Also updated some of the log messages.
This closesapache#621
// if state cannot be determined do nothing and bail out
829
829
if (determinedState == null) {
830
-
s_logger.warn("Agent state cannot be determined, do nothing");
831
-
returnfalse;
830
+
if (((System.currentTimeMillis() >> 10) - host.getLastPinged()) > AlertWait.value()) {
831
+
s_logger.warn("Agent " + hostId + " state cannot be determined for more than " + AlertWait + "(" + AlertWait.value() + ") seconds, will go to Alert state");
832
+
determinedState = Status.Alert;
833
+
} else {
834
+
s_logger.warn("Agent " + hostId + " state cannot be determined, do nothing");
835
+
returnfalse;
836
+
}
832
837
}
833
838
834
839
finalStatuscurrentStatus = host.getStatus();
835
-
s_logger.info("The state determined is " + determinedState);
840
+
s_logger.info("The agent " + hostId + " state determined is " + determinedState);
836
841
837
842
if (determinedState == Status.Down) {
838
-
s_logger.error("Host is down: " + host.getId() + "-" + host.getName() + ". Starting HA on the VMs");
843
+
Stringmessage = "Host is down: " + host.getId() + "-" + host.getName() + ". Starting HA on the VMs";
844
+
s_logger.error(message);
839
845
if (host.getType() != Host.Type.SecondaryStorage && host.getType() != Host.Type.ConsoleProxy) {
0 commit comments