hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r382937 - in /lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred: TaskInProgress.java TaskTracker.java
Date Fri, 03 Mar 2006 21:30:34 GMT
Author: cutting
Date: Fri Mar  3 13:30:32 2006
New Revision: 382937

URL: http://svn.apache.org/viewcvs?rev=382937&view=rev
Log:
Fix a couple of tasktracker bugs.

Modified:
    lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskInProgress.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskInProgress.java
URL: http://svn.apache.org/viewcvs/lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskInProgress.java?rev=382937&r1=382936&r2=382937&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskInProgress.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskInProgress.java Fri Mar  3 13:30:32
2006
@@ -39,7 +39,7 @@
 //
 ////////////////////////////////////////////////////////
 class TaskInProgress {
-    static final int MAX_TASK_EXECS = 10;
+    static final int MAX_TASK_EXECS = 1;
     static final int MAX_TASK_FAILURES = 4;    
     static final double SPECULATIVE_GAP = 0.2;
     static final long SPECULATIVE_LAG = 60 * 1000;
@@ -157,12 +157,14 @@
     public boolean isFailed() {
         return failed;
     }
+
     /**
      * Number of times the TaskInProgress has failed.
      */
     public int numTaskFailures() {
-        return numTaskFailures();
+        return numTaskFailures;
     }
+
     /**
      * Get the overall progress (from 0 to 1.0) for this TIP
      */
@@ -405,6 +407,7 @@
         // in more depth eventually...
         //
         if (isMapTask() &&
+            recentTasks.size() <= MAX_TASK_EXECS &&
             conf.getBoolean("mapred.speculative.execution", true) &&
             (averageProgress - progress >= SPECULATIVE_GAP) &&
             (System.currentTimeMillis() - startTime >= SPECULATIVE_LAG)) {

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java
URL: http://svn.apache.org/viewcvs/lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java?rev=382937&r1=382936&r2=382937&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java Fri Mar  3 13:30:32
2006
@@ -106,6 +106,8 @@
         // Clear out state tables
         this.tasks = new TreeMap();
         this.runningTasks = new TreeMap();
+        this.mapTotal = 0;
+        this.reduceTotal = 0;
 
         // port numbers
         this.taskReportPort = this.fConf.getInt("mapred.task.tracker.report.port", 50050);
@@ -326,8 +328,7 @@
                                 staleState = true;
                             }
                         } catch (Exception ex) {
-                            ex.printStackTrace();
-                            LOG.info("Lost connection to JobTracker [" + jobTrackAddr + "].
 Retrying...");
+                            LOG.log(Level.INFO, "Lost connection to JobTracker [" + jobTrackAddr
+ "].  Retrying...", ex);
                             try {
                                 Thread.sleep(5000);
                             } catch (InterruptedException ie) {
@@ -632,7 +633,11 @@
      */
     synchronized void reportTaskFinished(String taskid) {
         TaskInProgress tip = (TaskInProgress) tasks.get(taskid);
-        tip.taskFinished();
+        if (tip != null) {
+          tip.taskFinished();
+        } else {
+          LOG.warning("Unknown child task finshed: "+taskid+". Ignored.");
+        }
     }
 
     /** 



Mime
View raw message