hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bor...@apache.org
Subject svn commit: r1088807 - in /hadoop/common/branches/branch-0.20-security: ./ src/core/org/apache/hadoop/ipc/ src/hdfs/org/apache/hadoop/hdfs/server/datanode/
Date Mon, 04 Apr 2011 22:25:47 GMT
Author: boryas
Date: Mon Apr  4 22:25:46 2011
New Revision: 1088807

URL: http://svn.apache.org/viewvc?rev=1088807&view=rev
Log:
HDFS-1692. In secure mode, Datanode process doesn't exit when disks fail.

Modified:
    hadoop/common/branches/branch-0.20-security/CHANGES.txt
    hadoop/common/branches/branch-0.20-security/src/core/org/apache/hadoop/ipc/Server.java
    hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNode.java
    hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataXceiverServer.java
    hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDataset.java

Modified: hadoop/common/branches/branch-0.20-security/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security/CHANGES.txt?rev=1088807&r1=1088806&r2=1088807&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.20-security/CHANGES.txt Mon Apr  4 22:25:46 2011
@@ -36,6 +36,10 @@ Release 0.20.204.0 - unreleased
 
     HDFS-1189. Quota counts missed between clear quota and set quota.
     (John George via szetszwo)
+
+    HDFS-1692. In secure mode, Datanode process doesn't exit when disks 
+    fail. (bharathm via boryas)
+
   
   IMPROVEMENTS
 

Modified: hadoop/common/branches/branch-0.20-security/src/core/org/apache/hadoop/ipc/Server.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security/src/core/org/apache/hadoop/ipc/Server.java?rev=1088807&r1=1088806&r2=1088807&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security/src/core/org/apache/hadoop/ipc/Server.java
(original)
+++ hadoop/common/branches/branch-0.20-security/src/core/org/apache/hadoop/ipc/Server.java
Mon Apr  4 22:25:46 2011
@@ -53,6 +53,7 @@ import java.util.concurrent.ConcurrentHa
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
 
 import javax.security.sasl.Sasl;
 import javax.security.sasl.SaslException;
@@ -567,6 +568,12 @@ public abstract class Server {
         }
       }
       readPool.shutdown();
+      try {
+          readPool.awaitTermination(10, TimeUnit.SECONDS);
+      } catch (InterruptedException e) {
+       LOG.info("Exception occured in doStop:" + e.getMessage());
+      }
+      readPool.shutdownNow();
     }
 
     // The method that will return the next reader to work with

Modified: hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNode.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNode.java?rev=1088807&r1=1088806&r2=1088807&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNode.java
(original)
+++ hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNode.java
Mon Apr  4 22:25:46 2011
@@ -1566,7 +1566,14 @@ public class DataNode extends Configured
     } catch (Throwable e) {
       LOG.error(StringUtils.stringifyException(e));
       System.exit(-1);
-    }   
+    } finally {
+      // We need to add System.exit here because either shutdown was called or
+      // some disk related conditions like volumes tolerated or volumes required
+      // condition was not met. Also, In secure mode, control will go to Jsvc and
+      // the process hangs without System.exit.
+      LOG.info("Exiting Datanode");
+      System.exit(0);
+    }
   }
   
   public static void main(String args[]) {

Modified: hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataXceiverServer.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataXceiverServer.java?rev=1088807&r1=1088806&r2=1088807&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataXceiverServer.java
(original)
+++ hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataXceiverServer.java
Mon Apr  4 22:25:46 2011
@@ -21,6 +21,7 @@ import java.io.IOException;
 import java.net.ServerSocket;
 import java.net.Socket;
 import java.net.SocketTimeoutException;
+import java.nio.channels.AsynchronousCloseException;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -133,9 +134,13 @@ class DataXceiverServer implements Runna
             new DataXceiver(s, datanode, this)).start();
       } catch (SocketTimeoutException ignored) {
         // wake up to see if should continue to run
+      } catch (AsynchronousCloseException ace) {
+          LOG.warn(datanode.dnRegistration + ":DataXceiveServer:"
+                  + StringUtils.stringifyException(ace));
+          datanode.shouldRun = false;
       } catch (IOException ie) {
-        LOG.warn(datanode.dnRegistration + ":DataXceiveServer: " 
-                                + StringUtils.stringifyException(ie));
+        LOG.warn(datanode.dnRegistration + ":DataXceiveServer: IOException due to:"
+                                 + StringUtils.stringifyException(ie));
       } catch (Throwable te) {
         LOG.error(datanode.dnRegistration + ":DataXceiveServer: Exiting due to:" 
                                  + StringUtils.stringifyException(te));
@@ -145,9 +150,10 @@ class DataXceiverServer implements Runna
     try {
       ss.close();
     } catch (IOException ie) {
-      LOG.warn(datanode.dnRegistration + ":DataXceiveServer: " 
-                              + StringUtils.stringifyException(ie));
+      LOG.warn(datanode.dnRegistration + ":DataXceiveServer: Close exception due to: "
+                               + StringUtils.stringifyException(ie));
     }
+    LOG.info("Exiting DataXceiveServer");
   }
   
   void kill() {

Modified: hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDataset.java?rev=1088807&r1=1088806&r2=1088807&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
(original)
+++ hadoop/common/branches/branch-0.20-security/src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
Mon Apr  4 22:25:46 2011
@@ -591,6 +591,7 @@ public class FSDataset implements FSCons
             removed_vols = new ArrayList<FSVolume>(1);
           }
           removed_vols.add(volumes[idx]);
+          volumes[idx].dfsUsage.shutdown(); //Shutdown the running DU thread
           volumes[idx] = null; //remove the volume
         }
       }



Mime
View raw message