Browse Source

HDFS-5211. Race condition between DistributedFileSystem#close and FileSystem#close can cause return of a closed DistributedFileSystem instance from the FileSystem cache. Contributed by Chris Nauroth.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1@1524191 13f79535-47bb-0310-9956-ffa450edef68
Chris Nauroth 11 years ago
parent
commit
567035a53f
2 changed files with 6 additions and 3 deletions
  1. 4 0
      CHANGES.txt
  2. 2 3
      src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java

+ 4 - 0
CHANGES.txt

@@ -135,6 +135,10 @@ Release 1.3.0 - unreleased
     HDFS-4898. BlockPlacementPolicyWithNodeGroup.chooseRemoteRack() fails to
     properly fallback to local rack. (szetszwo)
 
+    HDFS-5211. Race condition between DistributedFileSystem#close and
+    FileSystem#close can cause return of a closed DistributedFileSystem instance
+    from the FileSystem cache. (cnauroth)
+
 Release 1.2.2 - unreleased
 
   INCOMPATIBLE CHANGES

+ 2 - 3
src/hdfs/org/apache/hadoop/hdfs/DistributedFileSystem.java

@@ -365,10 +365,9 @@ public class DistributedFileSystem extends FileSystem {
   /** {@inheritDoc} */
   public void close() throws IOException {
     try {
-      super.processDeleteOnExit();
-      dfs.close();
-    } finally {
       super.close();
+    } finally {
+      dfs.close();
     }
   }