HADOOP-9490. LocalFileSystem#reportChecksumFailure not closing the checksum file handle before rename. Contributed by Ivan Mitic.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1476609 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Suresh Srinivas 2013-04-27 16:10:31 +00:00
parent f5ef2db500
commit e2d901f4da
2 changed files with 5 additions and 0 deletions

View File

@ -525,6 +525,9 @@ Trunk (Unreleased)
HADOOP-9500. TestUserGroupInformation#testGetServerSideGroups fails on HADOOP-9500. TestUserGroupInformation#testGetServerSideGroups fails on
Windows due to failure to find winutils.exe. (Chris Nauroth via suresh) 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.5-beta - UNRELEASED Release 2.0.5-beta - UNRELEASED

View File

@ -130,6 +130,8 @@ public class LocalFileSystem extends ChecksumFileSystem {
} }
// move checksum file too // move checksum file too
File checkFile = ((RawLocalFileSystem)fs).pathToFile(getChecksumFile(p)); 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)); b = checkFile.renameTo(new File(badDir, checkFile.getName()+suffix));
if (!b) { if (!b) {
LOG.warn("Ignoring failure of renameTo"); LOG.warn("Ignoring failure of renameTo");