Skip to content

Commit ee4a0ed

Browse files
author
Suresh Srinivas
committed
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
1 parent a6c7230 commit ee4a0ed

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

hadoop-common-project/hadoop-common/CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,9 @@ Trunk (Unreleased)
525525

526526
HADOOP-9500. TestUserGroupInformation#testGetServerSideGroups fails on
527527
Windows due to failure to find winutils.exe. (Chris Nauroth via suresh)
528+
529+
HADOOP-9490. LocalFileSystem#reportChecksumFailure not closing the
530+
checksum file handle before rename. (Ivan Mitic via suresh)
528531

529532
Release 2.0.5-beta - UNRELEASED
530533

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/LocalFileSystem.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ public boolean reportChecksumFailure(Path p, FSDataInputStream in,
130130
}
131131
// move checksum file too
132132
File checkFile = ((RawLocalFileSystem)fs).pathToFile(getChecksumFile(p));
133+
// close the stream before rename to release the file handle
134+
sums.close();
133135
b = checkFile.renameTo(new File(badDir, checkFile.getName()+suffix));
134136
if (!b) {
135137
LOG.warn("Ignoring failure of renameTo");

0 commit comments

Comments
 (0)