Modified:
trunk/lib/flaptor-util-trunk.jar
trunk/src/com/flaptor/clusterfest/monitoring/MonitorNodeDescriptor.java
trunk/src/com/flaptor/clusterfest/monitoring/NodeState.java
Log:
clearer error distinguishing between cluster manager error and node
error in interface
Modified: trunk/lib/flaptor-util-trunk.jar
==============================================================================
Binary files. No diff available.
Modified: trunk/src/com/flaptor/clusterfest/monitoring/MonitorNodeDescriptor.java
==============================================================================
---
trunk/src/com/flaptor/clusterfest/monitoring/MonitorNodeDescriptor.java (original)
+++
trunk/src/com/flaptor/clusterfest/monitoring/MonitorNodeDescriptor.java
Thu Jul 17 15:31:34 2008
@@ -35,7 +35,6 @@
import com.flaptor.clusterfest.monitoring.node.Monitoreable;
import com.flaptor.util.Config;
import com.flaptor.util.DateUtil;
-import com.flaptor.util.Execute;
import com.flaptor.util.Execution;
import com.flaptor.util.FileSerializer;
import com.flaptor.util.Pair;
@@ -155,11 +154,11 @@
throw e;
} catch (NodeException e) {
logger.error("remote code exception", e.getCause());
- state = NodeState.createErrorState(e.getCause());
+ state = NodeState.createNodeErrorState(e.getCause());
throw e;
} catch (Throwable t) {
logger.error("unexpected throwable",t);
- state = NodeState.createErrorState(t);
+ state = NodeState.createClusterManagerErrorState(t);
} finally {
synchronized (states) {
states.add(state);
Modified: trunk/src/com/flaptor/clusterfest/monitoring/NodeState.java
==============================================================================
--- trunk/src/com/flaptor/clusterfest/monitoring/NodeState.java (original)
+++ trunk/src/com/flaptor/clusterfest/monitoring/NodeState.java Thu Jul
17 15:31:34 2008
@@ -50,17 +50,23 @@
state.sanity = UNREACHABLE_RESULT;
return state;
}
-
- public static NodeState createErrorState(Throwable t) {
+ private static String getStack(Throwable t) {
StringWriter stringWriter = new StringWriter();
PrintWriter printWriter = new PrintWriter(stringWriter);
t.printStackTrace(printWriter);
printWriter.flush();
stringWriter.flush();
- String stacktrace = stringWriter.getBuffer().toString();
-
+ return stringWriter.getBuffer().toString();
+ }
+ public static NodeState createNodeErrorState(Throwable t) {
NodeState state = new NodeState(null, null);
- state.sanity = new
NodeChecker.Result(NodeChecker.Sanity.ERROR, Arrays.asList(new
String[]{"Node throwing exception in clusterfest code", t.getMessage(), stacktrace}));
+ state.sanity = new
NodeChecker.Result(NodeChecker.Sanity.ERROR, Arrays.asList(new
String[]{"NODE throwing exception", t.getMessage(), getStack(t)}));
+ return state;
+ }
+
+ public static NodeState createClusterManagerErrorState(Throwable
t) {
+ NodeState state = new NodeState(null, null);
+ state.sanity = new
NodeChecker.Result(NodeChecker.Sanity.ERROR, Arrays.asList(new
String[]{"CLUSTER MANAGER throwing exception", t.getMessage(), getStack(t)}));
return state;
}