KVM HA: Fix CheckOnHostAnswer success flag when there is no heartbeat by sureshanaparti · Pull Request #13373 · apache/cloudstack · GitHub
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public Status getHostAgentStatus(Host host) {
}

Status hostStatusFromNeighbour = checkHostStatusWithNeighbourHosts(host);
logger.debug("{} status reported from itself: {} and neighbor: {}", host.toString(), hostStatusFromItself, hostStatusFromNeighbour);
Status hostStatus = hostStatusFromItself;
if (hostStatusFromNeighbour == Status.Up && (hostStatusFromItself == Status.Disconnected || hostStatusFromItself == Status.Down)) {
hostStatus = Status.Disconnected;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;

import com.cloud.agent.api.CheckOnHostAnswer;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;

Expand Down Expand Up @@ -3130,7 +3131,9 @@ public void testCheckOnHostCommand() {
assertNotNull(wrapper);

final Answer answer = wrapper.execute(command, libvirtComputingResourceMock);
assertFalse(answer.getResult());
assertTrue(answer.getResult());
assertTrue(answer instanceof CheckOnHostAnswer);
assertFalse(((CheckOnHostAnswer)answer).isAlive());

verify(libvirtComputingResourceMock, times(1)).getMonitor();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5807,7 +5807,7 @@ protected Answer execute(PingTestCommand cmd) {
}

protected Answer execute(CheckOnHostCommand cmd) {
return new CheckOnHostAnswer(cmd, null, "Not Implmeneted");
return new CheckOnHostAnswer(cmd, null, "Not Implemented");
}

protected Answer execute(ModifySshKeysCommand cmd) {
Expand Down
Loading