hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yhema...@apache.org
Subject svn commit: r791739 - in /hadoop/mapreduce/trunk: CHANGES.txt src/java/org/apache/hadoop/mapred/NodeHealthCheckerService.java src/test/mapred/org/apache/hadoop/mapred/TestNodeHealthService.java
Date Tue, 07 Jul 2009 07:50:16 GMT
Author: yhemanth
Date: Tue Jul  7 07:50:15 2009
New Revision: 791739

URL: http://svn.apache.org/viewvc?rev=791739&view=rev
Log:
MAPREDUCE-709. Fixes message displayed for a blacklisted node where the reason for blacklisting
is due to the health check script timing out. Contributed by Sreekanth Ramakrishnan.

Modified:
    hadoop/mapreduce/trunk/CHANGES.txt
    hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/NodeHealthCheckerService.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestNodeHealthService.java

Modified: hadoop/mapreduce/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/CHANGES.txt?rev=791739&r1=791738&r2=791739&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/CHANGES.txt (original)
+++ hadoop/mapreduce/trunk/CHANGES.txt Tue Jul  7 07:50:15 2009
@@ -133,3 +133,7 @@
     blacklisting a node on the JobTracker UI.
     (Sreekanth Ramakrishnan via yhemanth)
 
+    MAPREDUCE-709. Fixes message displayed for a blacklisted node where
+    the reason for blacklisting is due to the health check script
+    timing out. (Sreekanth Ramakrishnan via yhemanth)
+

Modified: hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/NodeHealthCheckerService.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/NodeHealthCheckerService.java?rev=791739&r1=791738&r2=791739&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/NodeHealthCheckerService.java
(original)
+++ hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/NodeHealthCheckerService.java
Tue Jul  7 07:50:15 2009
@@ -70,6 +70,8 @@
 
   static final String HEALTH_CHECK_SCRIPT_ARGUMENTS_PROPERTY = "mapred.healthChecker.script.args";
   /* end of configuration keys */
+  /** Time out error message */
+  static final String NODE_HEALTH_SCRIPT_TIMED_OUT_MSG = "Node health script timed out";
 
   /** Default frequency of running node health script */
   private static final long DEFAULT_HEALTH_CHECK_INTERVAL = 10 * 60 * 1000;
@@ -84,6 +86,7 @@
 
   private TimerTask timer;
   
+  
   private enum HealthCheckerExitStatus {
     SUCCESS,
     TIMED_OUT,
@@ -122,7 +125,11 @@
         status = HealthCheckerExitStatus.FAILED_WITH_EXIT_CODE;
       } catch (Exception e) {
         LOG.warn("Caught exception : " + e.getMessage());
-        status = HealthCheckerExitStatus.FAILED_WITH_EXCEPTION;
+        if (!shexec.isTimedOut()) {
+          status = HealthCheckerExitStatus.FAILED_WITH_EXCEPTION;
+        } else {
+          status = HealthCheckerExitStatus.TIMED_OUT;
+        }
         exceptionStackTrace = StringUtils.stringifyException(e);
       } finally {
         if (status == HealthCheckerExitStatus.SUCCESS) {
@@ -160,7 +167,7 @@
         setHealthStatus(true, "", now);
         break;
       case TIMED_OUT:
-        setHealthStatus(false, "Node health script timed out");
+        setHealthStatus(false, NODE_HEALTH_SCRIPT_TIMED_OUT_MSG);
         break;
       case FAILED_WITH_EXCEPTION:
         setHealthStatus(false, exceptionStackTrace);

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestNodeHealthService.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestNodeHealthService.java?rev=791739&r1=791738&r2=791739&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestNodeHealthService.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapred/TestNodeHealthService.java
Tue Jul  7 07:50:15 2009
@@ -152,8 +152,9 @@
     LOG.info("Checking Healthy--->timeout");
     assertFalse("Node health status reported healthy even after timeout",
         healthStatus.isNodeHealthy());
-    assertFalse("Node health status reported healthy even after timeout",
-        healthStatus.getHealthReport().isEmpty());
+    assertEquals("Node time out message not propogated", healthStatus
+        .getHealthReport(),
+        NodeHealthCheckerService.NODE_HEALTH_SCRIPT_TIMED_OUT_MSG);
   }
 
 }



Mime
View raw message