hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rang...@apache.org
Subject svn commit: r793111 - in /hadoop/hdfs/trunk: CHANGES.txt src/java/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java
Date Fri, 10 Jul 2009 21:17:29 GMT
Author: rangadi
Date: Fri Jul 10 21:17:29 2009
New Revision: 793111

URL: http://svn.apache.org/viewvc?rev=793111&view=rev
Log:
HDFS-415. BlockReceiver hangs in case of certain runtime exceptions. (Konstantin Boudnik via
rangadi)

Modified:
    hadoop/hdfs/trunk/CHANGES.txt
    hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java

Modified: hadoop/hdfs/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/CHANGES.txt?rev=793111&r1=793110&r2=793111&view=diff
==============================================================================
--- hadoop/hdfs/trunk/CHANGES.txt (original)
+++ hadoop/hdfs/trunk/CHANGES.txt Fri Jul 10 21:17:29 2009
@@ -62,6 +62,9 @@
     HDFS-438. Check for NULL before invoking GenericArgumentParser in
     DataNode. (Raghu Angadi)
 
+    HDFS-415. BlockReceiver hangs in case of certain runtime exceptions.
+    (Konstantin Boudnik via rangadi)
+
 Release 0.20.1 - Unreleased
 
   IMPROVEMENTS

Modified: hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java?rev=793111&r1=793110&r2=793111&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java (original)
+++ hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java Fri
Jul 10 21:17:29 2009
@@ -502,6 +502,7 @@
       String mirrAddr, BlockTransferThrottler throttlerArg,
       int numTargets) throws IOException {
 
+      boolean responderClosed = false;
       mirrorOut = mirrOut;
       mirrorAddr = mirrAddr;
       throttler = throttlerArg;
@@ -535,8 +536,10 @@
 
       // wait for all outstanding packet responses. And then
       // indicate responder to gracefully shutdown.
+      // Mark that responder has been closed for future processing
       if (responder != null) {
         ((PacketResponder)responder.getRunnable()).close();
+        responderClosed = true;
       }
 
       // if this write is for a replication request (and not
@@ -555,13 +558,15 @@
     } catch (IOException ioe) {
       LOG.info("Exception in receiveBlock for block " + block + 
                " " + ioe);
-      IOUtils.closeStream(this);
-      if (responder != null) {
-        responder.interrupt();
-      }
-      cleanupBlock();
       throw ioe;
     } finally {
+      if (!responderClosed) { // Abnormal termination of the flow above
+        IOUtils.closeStream(this);
+        if (responder != null) {
+          responder.interrupt();
+        }
+        cleanupBlock();
+      }
       if (responder != null) {
         try {
           responder.join();



Mime
View raw message