Przeglądaj źródła

HADOOP-241. Fix problem raised by CopyFiles on Windows. Contributed by Milind.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@409217 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting 19 lat temu
rodzic
commit
ace6074e06

+ 6 - 0
src/java/org/apache/hadoop/dfs/FSNamesystem.java

@@ -183,6 +183,12 @@ class FSNamesystem implements FSConstants {
           try {
             lmthread.join(3000);
           } catch (InterruptedException ie) {
+          } finally {
+              try {
+                dir.close();
+              } catch (IOException ex) {
+                  // do nothing
+              }
           }
         }
     }

+ 2 - 1
src/test/org/apache/hadoop/fs/TestCopyFiles.java

@@ -32,7 +32,8 @@ import org.apache.hadoop.util.CopyFiles;
 public class TestCopyFiles extends TestCase {
   
   private static final int NFILES = 20;
-  private static String TEST_ROOT_DIR = System.getProperty("test.build.data","/tmp");
+  private static Path TEST_ROOT_DIR = new Path(
+          System.getProperty("test.build.data","/tmp"));
   
   /** class MyFile contains enough information to recreate the contents of
    * a single file.