File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed
hadoop-common-project/hadoop-common
src/test/java/org/apache/hadoop/fs Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -356,11 +356,14 @@ Trunk (Unreleased)
356356 HADOOP-9431 TestSecurityUtil#testLocalHostNameForNullOrWild on systems where hostname
357357 contains capital letters (Chris Nauroth via sanjay)
358358
359- HADOOP-9261 S3n filesystem can move a directory under itself -and so lose data
360- (fixed in HADOOP-9258) (stevel)
359+ HADOOP-9261 S3n filesystem can move a directory under itself -and so lose data
360+ (fixed in HADOOP-9258) (stevel)
361361
362- HADOOP-9265 S3 blockstore filesystem breaks part of the Filesystem contract
363- (fixed in HADOOP-9258) (stevel)
362+ HADOOP-9265 S3 blockstore filesystem breaks part of the Filesystem contract
363+ (fixed in HADOOP-9258) (stevel)
364+
365+ HADOOP-9433 TestLocalFileSystem#testHasFileDescriptor leaks file handle
366+ (Chris Nauroth via sanjay)
364367
365368 OPTIMIZATIONS
366369
Original file line number Diff line number Diff line change 1919
2020import org .apache .hadoop .conf .Configuration ;
2121import org .apache .hadoop .fs .FileSystem .Statistics ;
22+ import org .apache .hadoop .io .IOUtils ;
2223import org .apache .hadoop .util .Shell ;
2324
2425import static org .apache .hadoop .fs .FileSystemTestHelper .*;
@@ -266,9 +267,14 @@ public void testHasFileDescriptor() throws IOException {
266267 LocalFileSystem fs = FileSystem .getLocal (conf );
267268 Path path = new Path (TEST_ROOT_DIR , "test-file" );
268269 writeFile (fs , path , 1 );
269- BufferedFSInputStream bis = new BufferedFSInputStream (
270- new RawLocalFileSystem ().new LocalFSFileInputStream (path ), 1024 );
271- assertNotNull (bis .getFileDescriptor ());
270+ BufferedFSInputStream bis = null ;
271+ try {
272+ bis = new BufferedFSInputStream (new RawLocalFileSystem ()
273+ .new LocalFSFileInputStream (path ), 1024 );
274+ assertNotNull (bis .getFileDescriptor ());
275+ } finally {
276+ IOUtils .cleanup (null , bis );
277+ }
272278 }
273279
274280 @ Test
You can’t perform that action at this time.
0 commit comments