diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 02bdf63718..9137e18780 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -351,6 +351,9 @@ Release 2.1.2 - UNRELEASED HDFS-5258. Skip tests in TestHDFSCLI that are not applicable on Windows. (Chuan Liu via cnauroth) + HDFS-5186. TestFileJournalManager fails on Windows due to file handle leaks. + (Chuan Liu via cnauroth) + Release 2.1.1-beta - 2013-09-23 INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFileJournalManager.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFileJournalManager.java index 44d1058806..342a167cac 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFileJournalManager.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFileJournalManager.java @@ -86,24 +86,27 @@ static long getNumberOfTransactions(FileJournalManager jm, long fromTxId, EditLogInputStream elis = null; try { while ((elis = allStreams.poll()) != null) { - elis.skipUntil(txId); - while (true) { - FSEditLogOp op = elis.readOp(); - if (op == null) { - break; + try { + elis.skipUntil(txId); + while (true) { + FSEditLogOp op = elis.readOp(); + if (op == null) { + break; + } + if (abortOnGap && (op.getTransactionId() != txId)) { + LOG.info("getNumberOfTransactions: detected gap at txId " + + fromTxId); + return numTransactions; + } + txId = op.getTransactionId() + 1; + numTransactions++; } - if (abortOnGap && (op.getTransactionId() != txId)) { - LOG.info("getNumberOfTransactions: detected gap at txId " + - fromTxId); - return numTransactions; - } - txId = op.getTransactionId() + 1; - numTransactions++; + } finally { + IOUtils.cleanup(LOG, elis); } } } finally { IOUtils.cleanup(LOG, allStreams.toArray(new EditLogInputStream[0])); - IOUtils.cleanup(LOG, elis); } return numTransactions; }