Kaynağa Gözat

Fix HADOOP-169. Don't fail reduce tasks if a call to the jobtracker to locate map outputs fails. Contributed by Owen.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@397321 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting 19 yıl önce
ebeveyn
işleme
a19c8e80bc

+ 3 - 0
CHANGES.txt

@@ -105,6 +105,9 @@ Trunk (unreleased)
     IOException, so that timeouts are handled appropriately.
     (omalley via cutting)
 
+28. Fix HADOOP-169.  Don't fail a reduce task if a call to the
+    jobtracker to locate map outputs fails.  (omalley via cutting)
+
 
 Release 0.1.1 - 2006-04-08
 

+ 8 - 4
src/java/org/apache/hadoop/mapred/ReduceTaskRunner.java

@@ -65,10 +65,14 @@ class ReduceTaskRunner extends TaskRunner {
       for (int i = 0; i < checkSize; i++) {
           neededStrings[i] = (String[]) needed.elementAt(i);
       }
-      MapOutputLocation[] locs =
-        jobClient.locateMapOutputs(task.getTaskId(), neededStrings);
-
-      if (locs.length == 0) {
+      MapOutputLocation[] locs = null;
+      try {
+        locs = jobClient.locateMapOutputs(task.getTaskId(), neededStrings);
+      } catch (IOException ie) {
+        LOG.info("Problem locating map outputs: " + 
+                 StringUtils.stringifyException(ie));
+      }
+      if (locs == null || locs.length == 0) {
         try {
           if (killed) {
             return false;