Author: sradia
Date: Mon Mar 25 22:30:30 2013
New Revision: 1460922
URL: http://svn.apache.org/r1460922
Log:
HADOOP-9433 TestLocalFileSystem#testHasFileDescriptor leaks file handle (Chris
Nauroth via sanjay)
Modified:
hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalFileSystem.java
Modified: hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt?rev=1460922&r1=1460921&r2=1460922&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
(original)
+++ hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt Mon Mar
25 22:30:30 2013
@@ -356,11 +356,14 @@ Trunk (Unreleased)
HADOOP-9431 TestSecurityUtil#testLocalHostNameForNullOrWild on systems
where hostname
contains capital letters (Chris Nauroth via sanjay)
- HADOOP-9261 S3n filesystem can move a directory under itself -and so
lose data
- (fixed in HADOOP-9258) (stevel)
+ HADOOP-9261 S3n filesystem can move a directory under itself -and so lose
data
+ (fixed in HADOOP-9258) (stevel)
- HADOOP-9265 S3 blockstore filesystem breaks part of the Filesystem
contract
- (fixed in HADOOP-9258) (stevel)
+ HADOOP-9265 S3 blockstore filesystem breaks part of the Filesystem contract
+ (fixed in HADOOP-9258) (stevel)
+
+ HADOOP-9433 TestLocalFileSystem#testHasFileDescriptor leaks file handle
+ (Chris Nauroth via sanjay)
OPTIMIZATIONS
Modified:
hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalFileSystem.java
URL:
http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalFileSystem.java?rev=1460922&r1=1460921&r2=1460922&view=diff
==============================================================================
---
hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalFileSystem.java
(original)
+++
hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalFileSystem.java
Mon Mar 25 22:30:30 2013
@@ -19,6 +19,7 @@ package org.apache.hadoop.fs;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem.Statistics;
+import org.apache.hadoop.io.IOUtils;
import org.apache.hadoop.util.Shell;
import static org.apache.hadoop.fs.FileSystemTestHelper.*;
@@ -266,9 +267,14 @@ public class TestLocalFileSystem {
LocalFileSystem fs = FileSystem.getLocal(conf);
Path path = new Path(TEST_ROOT_DIR, "test-file");
writeFile(fs, path, 1);
- BufferedFSInputStream bis = new BufferedFSInputStream(
- new RawLocalFileSystem().new LocalFSFileInputStream(path), 1024);
- assertNotNull(bis.getFileDescriptor());
+ BufferedFSInputStream bis = null;
+ try {
+ bis = new BufferedFSInputStream(new RawLocalFileSystem()
+ .new LocalFSFileInputStream(path), 1024);
+ assertNotNull(bis.getFileDescriptor());
+ } finally {
+ IOUtils.cleanup(null, bis);
+ }
}
@Test