hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sur...@apache.org
Subject svn commit: r1491535 - in /hadoop/common/branches/branch-1.2: CHANGES.txt src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNode.java
Date Mon, 10 Jun 2013 17:42:06 GMT
Author: suresh
Date: Mon Jun 10 17:42:05 2013
New Revision: 1491535

URL: http://svn.apache.org/r1491535
Log:
HDFS-4581. Merge r1461615 from branch-1

Modified:
    hadoop/common/branches/branch-1.2/CHANGES.txt
    hadoop/common/branches/branch-1.2/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNode.java

Modified: hadoop/common/branches/branch-1.2/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1.2/CHANGES.txt?rev=1491535&r1=1491534&r2=1491535&view=diff
==============================================================================
--- hadoop/common/branches/branch-1.2/CHANGES.txt (original)
+++ hadoop/common/branches/branch-1.2/CHANGES.txt Mon Jun 10 17:42:05 2013
@@ -20,6 +20,9 @@ Release 1.2.1 - Unreleased 
     MAPREDUCE-3859. Fix CapacityScheduler to correctly compute runtime queue
     limits for high-ram jobs. (Sergey Tryuber via acmurthy)
 
+    HDFS-4581. DataNode.checkDiskError should not be called on network errors.
+    (Rohit Kochar via kihwal)
+
 Release 1.2.0 - 2013.05.05
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/branches/branch-1.2/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNode.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1.2/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNode.java?rev=1491535&r1=1491534&r2=1491535&view=diff
==============================================================================
--- hadoop/common/branches/branch-1.2/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNode.java
(original)
+++ hadoop/common/branches/branch-1.2/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNode.java
Mon Jun 10 17:42:05 2013
@@ -27,8 +27,10 @@ import java.io.OutputStream;
 import java.net.InetSocketAddress;
 import java.net.ServerSocket;
 import java.net.Socket;
+import java.net.SocketException;
 import java.net.SocketTimeoutException;
 import java.net.UnknownHostException;
+import java.nio.channels.ClosedByInterruptException;
 import java.nio.channels.ServerSocketChannel;
 import java.nio.channels.SocketChannel;
 import java.security.NoSuchAlgorithmException;
@@ -923,10 +925,16 @@ public class DataNode extends Configured
   /** Check if there is no space in disk 
    *  @param e that caused this checkDiskError call
    **/
-  protected void checkDiskError(Exception e ) throws IOException {
-    
-    LOG.warn("checkDiskError: exception: ", e);
-    
+  protected void checkDiskError(Exception e ) throws IOException {    
+    LOG.warn("checkDiskError: exception: ", e);  
+    if (e instanceof SocketException || e instanceof SocketTimeoutException
+    	  || e instanceof ClosedByInterruptException 
+    	  || e.getMessage().startsWith("Broken pipe")) {
+      LOG.info("Not checking disk as checkDiskError was called on a network" +
+        " related exception");	
+      return;
+    }
+
     if (e.getMessage() != null &&
         e.getMessage().startsWith("No space left on device")) {
       throw new DiskOutOfSpaceException("No space left on device");
@@ -1543,8 +1551,11 @@ public class DataNode extends Configured
         LOG.warn(dnRegistration + ":Failed to transfer " + b + " to " + targets[0].getName()
             + " got " + StringUtils.stringifyException(ie));
         // check if there are any disk problem
-        datanode.checkDiskError();
-        
+        try{
+          checkDiskError(ie);
+        } catch(IOException e) {
+          LOG.warn("DataNode.checkDiskError failed in run() with: ", e);
+        }        
       } finally {
         xmitsInProgress.getAndDecrement();
         IOUtils.closeStream(blockSender);



Mime
View raw message