Преглед на файлове

HADOOP-2756. NPE in DFSClient while closing DFSOutputStreams
under load. (rangadi)


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

Raghu Angadi преди 17 години
родител
ревизия
6fc07a3d2c
променени са 2 файла, в които са добавени 13 реда и са изтрити 10 реда
  1. 3 0
      CHANGES.txt
  2. 10 10
      src/java/org/apache/hadoop/dfs/DFSClient.java

+ 3 - 0
CHANGES.txt

@@ -117,6 +117,9 @@ Release 0.16.1 - Unreleased
     naming convention that will avoid clashes in multi-user shared 
     cluster scenario. (Hemanth Yamijala via nigel)
 
+    HADOOP-2756. NPE in DFSClient while closing DFSOutputStreams 
+    under load. (rangadi)
+
 Release 0.16.0 - 2008-02-07
 
   INCOMPATIBLE CHANGES

+ 10 - 10
src/java/org/apache/hadoop/dfs/DFSClient.java

@@ -2260,11 +2260,17 @@ class DFSClient implements FSConstants {
  
         // wait for threads to finish processing
         streamer.close();
-
+        // wait for threads to exit
+        streamer.join();
+        
+        // shutdown response after streamer has exited.
+        if (response != null) {
+          response.close();
+          response.join();
+          response = null;
+        }
+        
         synchronized (dataQueue) {
-          if (response != null) {
-            response.close();
-          }
           if (blockStream != null) {
             blockStream.writeInt(0); // indicate end-of-block to datanode
             blockStream.close();
@@ -2276,15 +2282,9 @@ class DFSClient implements FSConstants {
           }
         }
 
-        // wait for threads to exit
-        streamer.join();
-        if (response != null) {
-          response.join();
-        }
         streamer = null;
         blockStream = null;
         blockReplyStream = null;
-        response = null;
 
         long localstart = System.currentTimeMillis();
         boolean fileComplete = false;