diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 22f80702a39..08fc4c6c1af 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -338,6 +338,9 @@ Release 2.0.5-beta - UNRELEASED HADOOP-9500. TestUserGroupInformation#testGetServerSideGroups fails on Windows due to failure to find winutils.exe. (Chris Nauroth via suresh) + + HADOOP-9490. LocalFileSystem#reportChecksumFailure not closing the + checksum file handle before rename. (Ivan Mitic via suresh) Release 2.0.4-beta - UNRELEASED diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/LocalFileSystem.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/LocalFileSystem.java index 7db348c557d..879d7212c89 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/LocalFileSystem.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/LocalFileSystem.java @@ -130,6 +130,8 @@ public boolean reportChecksumFailure(Path p, FSDataInputStream in, } // move checksum file too File checkFile = ((RawLocalFileSystem)fs).pathToFile(getChecksumFile(p)); + // close the stream before rename to release the file handle + sums.close(); b = checkFile.renameTo(new File(badDir, checkFile.getName()+suffix)); if (!b) { LOG.warn("Ignoring failure of renameTo");