hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cdoug...@apache.org
Subject svn commit: r644903 - in /hadoop/core/trunk: CHANGES.txt src/java/org/apache/hadoop/mapred/MapTask.java
Date Fri, 04 Apr 2008 20:48:03 GMT
Author: cdouglas
Date: Fri Apr  4 13:48:01 2008
New Revision: 644903

URL: http://svn.apache.org/viewvc?rev=644903&view=rev
Log:
HADOOP-3166. Fix an ArrayIndexOutOfBoundsException in the spill thread
and make exception handling more promiscuous to catch similar conditions.


Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/java/org/apache/hadoop/mapred/MapTask.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=644903&r1=644902&r2=644903&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Fri Apr  4 13:48:01 2008
@@ -498,6 +498,10 @@
     HADOOP-3083. The fsimage does not store leases. This would have to be
     reworked in the next release to support appends. (dhruba)
 
+    HADOOP-3166. Fix an ArrayIndexOutOfBoundsException in the spill thread
+    and make exception handling more promiscuous to catch this condition.
+    (cdouglas)
+
 Release 0.16.3 - Unreleased
 
   BUG FIXES

Modified: hadoop/core/trunk/src/java/org/apache/hadoop/mapred/MapTask.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/java/org/apache/hadoop/mapred/MapTask.java?rev=644903&r1=644902&r2=644903&view=diff
==============================================================================
--- hadoop/core/trunk/src/java/org/apache/hadoop/mapred/MapTask.java (original)
+++ hadoop/core/trunk/src/java/org/apache/hadoop/mapred/MapTask.java Fri Apr  4 13:48:01 2008
@@ -312,7 +312,7 @@
 
     // spill accounting
     private volatile int numSpills = 0;
-    private volatile IOException sortSpillException = null;
+    private volatile Throwable sortSpillException = null;
     private final int softRecordLimit;
     private final int softBufferLimit;
     private final Object spillLock = new Object();
@@ -424,7 +424,8 @@
                               + value.getClass().getName());
       }
       if (sortSpillException != null) {
-        throw sortSpillException;
+        throw (IOException)new IOException("Spill failed"
+            ).initCause(sortSpillException);
       }
       try {
         int keystart = bufindex;
@@ -588,8 +589,8 @@
         synchronized(spillLock) {
           do {
             if (sortSpillException != null) {
-              throw (IOException)new IOException().initCause(
-                  sortSpillException);
+              throw (IOException)new IOException("Spill failed"
+                  ).initCause(sortSpillException);
             }
 
             // sufficient accounting space?
@@ -679,7 +680,8 @@
         }
       }
       if (sortSpillException != null) {
-        throw (IOException)new IOException().initCause(sortSpillException);
+        throw (IOException)new IOException("Spill failed"
+            ).initCause(sortSpillException);
       }
       if (kvend != kvindex) {
         kvend = kvindex;
@@ -698,7 +700,7 @@
       public void run() {
         try {
           sortAndSpill();
-        } catch (IOException e) {
+        } catch (Throwable e) {
           sortSpillException = e;
         } finally {
           synchronized(spillLock) {
@@ -850,7 +852,7 @@
     private void getVBytesForOffset(int kvoff, InMemValBytes vbytes) {
       final int nextindex = kvoff / ACCTSIZE == kvend - 1
         ? bufend
-        : kvindices[kvoff + ACCTSIZE + KEYSTART];
+        : kvindices[(kvoff + ACCTSIZE + KEYSTART) % kvindices.length];
       int vallen = (nextindex > kvindices[kvoff + VALSTART])
         ? nextindex - kvindices[kvoff + VALSTART]
         : (bufvoid - kvindices[kvoff + VALSTART]) + nextindex;



Mime
View raw message