Skip to content
Merged
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 @@ -181,7 +181,7 @@ protected String runScriptRetry(String cmdString, OutputInterpreter interpreter)
return result;
}

public Boolean checkingHB() {
public Boolean checkingHeartBeat() {
// TODO Auto-generated method stub
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public KVMHAChecker(List<NfsStoragePool> pools, String host) {
* means heartbeating is stopped definitely
*/
@Override
public Boolean checkingHB() {
public Boolean checkingHeartBeat() {
List<Boolean> results = new ArrayList<Boolean>();
for (NfsStoragePool pool : _pools) {
Script cmd = new Script(s_heartBeatPath, _heartBeatCheckerTimeout, s_logger);
Expand Down Expand Up @@ -77,6 +77,6 @@ public Boolean checkingHB() {
public Boolean call() throws Exception {
// s_logger.addAppender(new org.apache.log4j.ConsoleAppender(new
// org.apache.log4j.PatternLayout(), "System.out"));
return checkingHB();
return checkingHeartBeat();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public KVMHAVMActivityChecker(final NfsStoragePool pool, final String host, fina
}

@Override
public Boolean checkingHB() {
public Boolean checkingHeartBeat() {
Script cmd = new Script(vmActivityCheckPath, activityScriptTimeout.getStandardSeconds(), LOG);
cmd.add("-i", nfsStoragePool._poolIp);
cmd.add("-p", nfsStoragePool._poolMountSourcePath);
Expand All @@ -52,11 +52,14 @@ public Boolean checkingHB() {
cmd.add("-t", String.valueOf(String.valueOf(System.currentTimeMillis() / 1000)));
cmd.add("-d", String.valueOf(suspectTimeInSeconds));
OutputInterpreter.OneLineParser parser = new OutputInterpreter.OneLineParser();

Comment thread
sureshanaparti marked this conversation as resolved.
String result = cmd.execute(parser);
LOG.debug("KVMHAVMActivityChecker pool: " + nfsStoragePool._poolIp);
LOG.debug("KVMHAVMActivityChecker result: " + result);
LOG.debug("KVMHAVMActivityChecker parser: " + parser.getLine());
if (result == null && parser.getLine().contains("DEAD")) {
String parsedLine = parser.getLine();

LOG.debug(String.format("Checking heart beat with KVMHAVMActivityChecker [{command=\"%s\", result: \"%s\", log: \"%s\", pool: \"%s\"}].", cmd.toString(), result, parsedLine, nfsStoragePool._poolIp));

if (result == null && parsedLine.contains("DEAD")) {
LOG.warn(String.format("Checking heart beat with KVMHAVMActivityChecker command [%s] returned [%s]. It is [%s]. It may cause a shutdown of host IP [%s].", cmd.toString(), result, parsedLine, hostIP));
return false;
} else {
return true;
Expand All @@ -65,6 +68,6 @@ public Boolean checkingHB() {

@Override
public Boolean call() throws Exception {
return checkingHB();
return checkingHeartBeat();
}
}