You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by om...@apache.org on 2011/03/04 05:39:09 UTC

svn commit: r1077638 - in /hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred: Counters.java TaskTracker.java

Author: omalley
Date: Fri Mar  4 04:39:08 2011
New Revision: 1077638

URL: http://svn.apache.org/viewvc?rev=1077638&view=rev
Log:
commit e1829b5fd83afcb442c3d335231c9a3a36ccfc93
Author: Arun C Murthy <ac...@apache.org>
Date:   Wed Aug 4 01:06:03 2010 -0700

    MAPREDUCE-1943. Minor improvement to error messages on hitting limits on Counters.

Modified:
    hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/Counters.java
    hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/TaskTracker.java

Modified: hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/Counters.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/Counters.java?rev=1077638&r1=1077637&r2=1077638&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/Counters.java (original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/Counters.java Fri Mar  4 04:39:08 2011
@@ -308,8 +308,8 @@ public class Counters implements Writabl
         }
         numCounters = (numCounters == 0) ? Counters.this.size(): numCounters; 
         if (numCounters >= MAX_COUNTER_LIMIT) {
-          throw new RuntimeException("Exceeded the number of counters: " 
-              + "Num = " + numCounters + " " + "Limit: " + MAX_COUNTER_LIMIT);
+          throw new RuntimeException("Error: Exceeded limits on number of counters - " 
+              + "Counters=" + numCounters + " Limit=" + MAX_COUNTER_LIMIT);
         }
         result = new Counter(shortName, localize(shortName + ".name", shortName), 0L);
         subcounters.put(shortName, result);
@@ -406,9 +406,9 @@ public class Counters implements Writabl
     if (result == null) {
       /** check if we have exceeded the max number on groups **/
       if (counters.size() > MAX_GROUP_LIMIT) {
-        throw new RuntimeException("Number of groups in Counters" +
-        		" exceeded: limit " 
-            + MAX_GROUP_LIMIT);
+        throw new RuntimeException(
+            "Error: Exceeded limits on number of groups in counters - " +
+            "Groups=" + counters.size() +" Limit=" + MAX_GROUP_LIMIT);
       }
       result = new Group(shortGroupName);
       counters.put(shortGroupName, result);

Modified: hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/TaskTracker.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/TaskTracker.java?rev=1077638&r1=1077637&r2=1077638&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/TaskTracker.java (original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/TaskTracker.java Fri Mar  4 04:39:08 2011
@@ -2454,12 +2454,17 @@ public class TaskTracker implements MRCo
       }
       
       /** check for counter limits and fail the task in case limits are exceeded **/
-      if (taskStatus.getCounters().size() > Counters.MAX_COUNTER_LIMIT ||
-          taskStatus.getCounters().getGroupNames().size() > Counters.MAX_GROUP_LIMIT) {
-        LOG.warn("Killing task " + task.getTaskID() + " :Exceeded limit on counters.");
+      Counters taskCounters = taskStatus.getCounters();
+      if (taskCounters.size() > Counters.MAX_COUNTER_LIMIT ||
+          taskCounters.getGroupNames().size() > Counters.MAX_GROUP_LIMIT) {
+        LOG.warn("Killing task " + task.getTaskID() + ": " +
+        		"Exceeded limit on counters.");
         try { 
-          reportDiagnosticInfo("Error: Exceeded counter limits of counter:" 
-              + Counters.MAX_COUNTER_LIMIT  + " Group:" + Counters.MAX_GROUP_LIMIT);
+          reportDiagnosticInfo("Error: Exceeded counter limits - " +
+          		"Counters=" + taskCounters.size() + " Limit=" 
+              + Counters.MAX_COUNTER_LIMIT  + ". " + 
+              "Groups=" + taskCounters.getGroupNames().size() + " Limit=" +
+              Counters.MAX_GROUP_LIMIT);
           kill(true);
         } catch(IOException ie) {
           LOG.error("Error killing task " + task.getTaskID(), ie);