hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r1076954 - in /hadoop/common/branches/branch-0.20-security-patches/src: mapred/org/apache/hadoop/mapred/NodeHealthCheckerService.java test/org/apache/hadoop/mapred/TestNodeHealthService.java
Date Fri, 04 Mar 2011 03:25:36 GMT
Author: omalley
Date: Fri Mar  4 03:25:36 2011
New Revision: 1076954

URL: http://svn.apache.org/viewvc?rev=1076954&view=rev
Log:
commit c4552dbc8fb5bbf76f7e04cb0c97316a70291d79
Author: Lee Tucker <ltucker@yahoo-inc.com>
Date:   Thu Jul 30 17:40:42 2009 -0700

    Applying patch 2870656.mr709.patch

Modified:
    hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/NodeHealthCheckerService.java
    hadoop/common/branches/branch-0.20-security-patches/src/test/org/apache/hadoop/mapred/TestNodeHealthService.java

Modified: hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/NodeHealthCheckerService.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/NodeHealthCheckerService.java?rev=1076954&r1=1076953&r2=1076954&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/NodeHealthCheckerService.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/NodeHealthCheckerService.java
Fri Mar  4 03:25:36 2011
@@ -70,6 +70,8 @@ class NodeHealthCheckerService {
 
   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 @@ class NodeHealthCheckerService {
 
   private TimerTask timer;
   
+  
   private enum HealthCheckerExitStatus {
     SUCCESS,
     TIMED_OUT,
@@ -122,7 +125,11 @@ class NodeHealthCheckerService {
         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 @@ class NodeHealthCheckerService {
         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/common/branches/branch-0.20-security-patches/src/test/org/apache/hadoop/mapred/TestNodeHealthService.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/test/org/apache/hadoop/mapred/TestNodeHealthService.java?rev=1076954&r1=1076953&r2=1076954&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/test/org/apache/hadoop/mapred/TestNodeHealthService.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/test/org/apache/hadoop/mapred/TestNodeHealthService.java
Fri Mar  4 03:25:36 2011
@@ -152,8 +152,9 @@ public class TestNodeHealthService exten
     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