Browse Source

HADOOP-3760. Fix a bug with HDFS file close() mistakenly introduced
by HADOOP-3681. (Lohit Vijayarenu via rangadi)


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

Raghu Angadi 17 years ago
parent
commit
a529dc6724
2 changed files with 5 additions and 7 deletions
  1. 3 0
      CHANGES.txt
  2. 2 7
      src/java/org/apache/hadoop/dfs/DFSClient.java

+ 3 - 0
CHANGES.txt

@@ -4,6 +4,9 @@ Release 0.17.2 - Unreleased
 
   BUG FIXES
 
+    HADOOP-3760. Fix a bug with HDFS file close() mistakenly introduced
+    by HADOOP-3681. (Lohit Vijayarenu via rangadi)
+
     HADOOP-3707. NameNode keeps a count of number of blocks scheduled 
     to be written to a datanode and uses it to avoid allocating more
     blocks than a datanode can hold. (rangadi)

+ 2 - 7
src/java/org/apache/hadoop/dfs/DFSClient.java

@@ -2630,8 +2630,8 @@ class DFSClient implements FSConstants {
           }
 
         flushInternal();             // flush all data to Datanodes
-        isClosed();
-        closed = true;
+        isClosed();   // check to see if flushInternal had any exceptions
+        closed = true; // allow closeThreads() to showdown threads
 
         closeThreads();
         
@@ -2653,8 +2653,6 @@ class DFSClient implements FSConstants {
 
         long localstart = System.currentTimeMillis();
         boolean fileComplete = false;
-        int fileCompleteRetry = 0;
-        final int checkFileCompleteRetry = 10;
         while (!fileComplete) {
           fileComplete = namenode.complete(src, clientName);
           if (!fileComplete) {
@@ -2665,9 +2663,6 @@ class DFSClient implements FSConstants {
               }
             } catch (InterruptedException ie) {
             }
-            // after retrying for checkFileCompleteRetry times check isClosed() 
-            if ((++fileCompleteRetry % checkFileCompleteRetry) == 0) 
-              isClosed();
           }
         }
       } finally {