瀏覽代碼

HADOOP-3154. Catch all Throwables from the SpillThread in MapTask, rather
than IOExceptions only. Contributed by Devaraj Das.



git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/branches/branch-0.16@644914 13f79535-47bb-0310-9956-ffa450edef68

Christopher Douglas 17 年之前
父節點
當前提交
b20c2904d3
共有 2 個文件被更改,包括 12 次插入7 次删除
  1. 5 0
      CHANGES.txt
  2. 7 7
      src/java/org/apache/hadoop/mapred/MapTask.java

+ 5 - 0
CHANGES.txt

@@ -2,9 +2,14 @@ Hadoop Change Log
 
 Release 0.16.3 - Unreleased
 
+  BUG FIXES
+
     HADOOP-3010. Fix ConcurrentModificationException in ipc.Server.Responder.
     (rangadi)
 
+    HADOOP-3154. Catch all Throwables from the SpillThread in MapTask, rather
+    than IOExceptions only. (ddas via cdouglas)
+
 Release 0.16.2 - 2008-04-02
 
   BUG FIXES

+ 7 - 7
src/java/org/apache/hadoop/mapred/MapTask.java

@@ -277,7 +277,7 @@ class MapTask extends Task {
     private final Object pendingKeyvalBufferLock = new Object();
     // since sort-spill and collect are done concurrently, exceptions are 
     // passed through shared variable
-    private volatile IOException sortSpillException; 
+    private volatile Throwable sortSpillException; 
     private int maxBufferSize; //the max amount of in-memory space after which
                                //we will spill the keyValBuffer to disk
     private int numSpills; //maintains the no. of spills to disk done so far
@@ -373,7 +373,7 @@ class MapTask extends Task {
       
       // check if the earlier sort-spill generated an exception
       if (sortSpillException != null) {
-        throw sortSpillException;
+        throw (IOException) new IOException().initCause(sortSpillException);
       }
       
       if (keyValBuffer == null) {
@@ -426,7 +426,7 @@ class MapTask extends Task {
 
         // check if the earlier sort-spill thread generated an exception
         if (sortSpillException != null) {
-          throw sortSpillException;
+          throw (IOException) new IOException().initCause(sortSpillException);
         }
         
         // Start the sort-spill thread. While the sort and spill takes place 
@@ -501,8 +501,8 @@ class MapTask extends Task {
         numSpills++;
         out.close();
         indexOut.close();
-      } catch (IOException ioe) {
-        sortSpillException = ioe;
+      } catch (Throwable t) {
+        sortSpillException = t;
       } finally { // make sure that the collector never waits indefinitely
         pendingKeyvalBuffer = null;
         for (int i = 0; i < partitions; i++) {
@@ -700,7 +700,7 @@ class MapTask extends Task {
       
       // check if the earlier sort-spill thread generated an exception
       if (sortSpillException != null) {
-        throw sortSpillException;
+        throw (IOException) new IOException().initCause(sortSpillException);
       }
       
       if (keyValBuffer != null && keyValBuffer.getLength() > 0) {
@@ -716,7 +716,7 @@ class MapTask extends Task {
       
       // check if the last sort-spill thread generated an exception
       if (sortSpillException != null) {
-        throw sortSpillException;
+        throw (IOException) new IOException().initCause(sortSpillException);
       }
       mergeParts();
     }