Browse Source

Merge -r 733886:733887 from trunk to move the change of HADOOP-5008 into branch 0.20.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/branches/branch-0.20@733889 13f79535-47bb-0310-9956-ffa450edef68
Hairong Kuang 16 years ago
parent
commit
ece58fbddf
2 changed files with 9 additions and 2 deletions
  1. 3 0
      CHANGES.txt
  2. 6 2
      src/test/org/apache/hadoop/hdfs/TestReplication.java

+ 3 - 0
CHANGES.txt

@@ -571,6 +571,9 @@ Release 0.19.1 - Unreleased
 
     HADOOP-4982. TestFsck should run in Eclipse. (shv)
 
+    HADOOP-5008. TestReplication#testPendingReplicationRetry leaves an opened
+    fd unclosed. (hairong)
+
 Release 0.19.0 - 2008-11-18
 
   INCOMPATIBLE CHANGES

+ 6 - 2
src/test/org/apache/hadoop/hdfs/TestReplication.java

@@ -350,8 +350,12 @@ public class TestReplication extends TestCase {
             long len = blockFile.length();
             assertTrue(len > 50);
             RandomAccessFile blockOut = new RandomAccessFile(blockFile, "rw");
-            blockOut.seek(len/3);
-            blockOut.write(buffer, 0, 25);
+            try {
+              blockOut.seek(len/3);
+              blockOut.write(buffer, 0, 25);
+            } finally {
+              blockOut.close();
+            }
           }
           fileCount++;
         }