Переглянути джерело

HADOOP-3139. Remove the consistency check for the FileSystem cache in
closeAll() that causes spurious warnings and a deadlock.
(Tsz Wo (Nicholas), SZE via cdouglas)



git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@644985 13f79535-47bb-0310-9956-ffa450edef68

Christopher Douglas 17 роки тому
батько
коміт
1a6624a20e

+ 4 - 0
CHANGES.txt

@@ -518,6 +518,10 @@ Release 0.16.3 - Unreleased
     HADOOP-3159. Avoid file system cache being overwritten whenever
     configuration is modified. (Tsz Wo (Nicholas), SZE via hairong)
 
+    HADOOP-3139. Remove the consistency check for the FileSystem cache in
+    closeAll() that causes spurious warnings and a deadlock.
+    (Tsz Wo (Nicholas), SZE via cdouglas)
+
 Release 0.16.2 - 2008-04-02
 
   BUG FIXES

+ 1 - 1
src/java/org/apache/hadoop/dfs/DistributedFileSystem.java

@@ -222,7 +222,7 @@ public class DistributedFileSystem extends FileSystem {
   }
 
   /** {@inheritDoc} */
-  public synchronized void close() throws IOException {
+  public void close() throws IOException {
     try {
       dfs.close();
     } finally {

+ 1 - 1
src/java/org/apache/hadoop/dfs/HftpFileSystem.java

@@ -74,7 +74,7 @@ public class HftpFileSystem extends FileSystem {
   public void initialize(URI name, Configuration conf) throws IOException {
     setConf(conf);
     try {
-      this.ugi = UnixUserGroupInformation.login(conf);
+      this.ugi = UnixUserGroupInformation.login(conf, true);
     } catch (LoginException le) {
       throw new IOException(StringUtils.stringifyException(le));
     }

+ 0 - 7
src/java/org/apache/hadoop/fs/FileSystem.java

@@ -1318,13 +1318,6 @@ public abstract class FileSystem extends Configured implements Closeable {
         remove(key, fs);
 
         if (fs != null) {
-          //check consistency
-          if (!new Key(fs).equals(key)) {
-            exceptions.add(new IOException(fs.getClass().getSimpleName()
-                + "(=" + fs + ") and " + key.getClass().getSimpleName()
-                + "(=" + key + ") do not match."));
-          }
-
           try {
             fs.close();
           }

+ 23 - 0
src/test/org/apache/hadoop/fs/TestFileSystem.java

@@ -503,4 +503,27 @@ public class TestFileSystem extends TestCase {
       }
     }
   }
+    
+  public void testFsClose() throws Exception {
+    {
+      Configuration conf = new Configuration();
+      new Path("file:///").getFileSystem(conf);
+      UnixUserGroupInformation.login(conf, true);
+      FileSystem.closeAll();
+    }
+
+    {
+      Configuration conf = new Configuration();
+      new Path("hftp://localhost:12345/").getFileSystem(conf);
+      UnixUserGroupInformation.login(conf, true);
+      FileSystem.closeAll();
+    }
+
+    {
+      Configuration conf = new Configuration();
+      FileSystem fs = new Path("hftp://localhost:12345/").getFileSystem(conf);
+      UnixUserGroupInformation.login(fs.getConf(), true);
+      FileSystem.closeAll();
+    }
+  }
 }