You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-commits@hadoop.apache.org by dd...@apache.org on 2009/08/11 07:47:12 UTC

svn commit: r802997 - in /hadoop/mapreduce/trunk: CHANGES.txt src/java/org/apache/hadoop/mapred/Task.java

Author: ddas
Date: Tue Aug 11 05:47:11 2009
New Revision: 802997

URL: http://svn.apache.org/viewvc?rev=802997&view=rev
Log:
MAPREDUCE-838. Fixes a problem in the way commit of task outputs happens. The bug was that even if commit failed, the task would be declared as successful. Contributed by Amareshwari Sriramadasu.

Modified:
    hadoop/mapreduce/trunk/CHANGES.txt
    hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/Task.java

Modified: hadoop/mapreduce/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/CHANGES.txt?rev=802997&r1=802996&r2=802997&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/CHANGES.txt (original)
+++ hadoop/mapreduce/trunk/CHANGES.txt Tue Aug 11 05:47:11 2009
@@ -337,3 +337,7 @@
 
     MAPREDUCE-845. Fix a findbugs heap size problem in build.xml and add
     a new property findbugs.heap.size.  (Lee Tucker via szetszwo)
+
+    MAPREDUCE-838. Fixes a problem in the way commit of task outputs
+    happens. The bug was that even if commit failed, the task would
+    be declared as successful. (Amareshwari Sriramadasu via ddas)

Modified: hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/Task.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/Task.java?rev=802997&r1=802996&r2=802997&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/Task.java (original)
+++ hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/Task.java Tue Aug 11 05:47:11 2009
@@ -740,27 +740,30 @@
           }
           reporter.setProgressFlag();
         }
-        // task can Commit now  
-        try {
-          LOG.info("Task " + taskId + " is allowed to commit now");
-          committer.commitTask(taskContext);
-          return;
-        } catch (IOException iee) {
-          LOG.warn("Failure committing: " + 
-                    StringUtils.stringifyException(iee));
-          discardOutput(taskContext);
-          throw iee;
-        }
+        break;
       } catch (IOException ie) {
         LOG.warn("Failure asking whether task can commit: " + 
             StringUtils.stringifyException(ie));
         if (--retries == 0) {
-          //if it couldn't commit a successfully then delete the output
+          //if it couldn't query successfully then delete the output
           discardOutput(taskContext);
           System.exit(68);
         }
       }
     }
+    
+    // task can Commit now  
+    try {
+      LOG.info("Task " + taskId + " is allowed to commit now");
+      committer.commitTask(taskContext);
+      return;
+    } catch (IOException iee) {
+      LOG.warn("Failure committing: " + 
+        StringUtils.stringifyException(iee));
+      //if it couldn't commit a successfully then delete the output
+      discardOutput(taskContext);
+      throw iee;
+    }
   }
 
   private