[ 
https://issues.apache.org/jira/browse/HADOOP-9278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13570728#comment-13570728
 ] 

Chris Nauroth commented on HADOOP-9278:
---------------------------------------

The invalid HAR URI is caused here in {{TestHarFileSystemBasics}}:

{code}
  private static final Path rootPath = new Path(
      new File(ROOT_PATH).getAbsolutePath() + "/localfs");
{code}

On Windows, this creates a path that includes the drive specifier.  Later, this 
gets used to construct a HAR URI for testing, which isn't valid, because it 
doesn't adhere to the the protocol-host format used by HAR URIs.

The file handle leak happens in {{HarFileSystem#HarMetaData#parseMetaData}}:

{code}
     private void parseMetaData() throws IOException {
      FSDataInputStream in = fs.open(masterIndexPath);
{code}

This method opens the _masterindex file, but not all code paths guarantee that 
the file will be closed.  For example, parsing an invalid version throws an 
exception before the _masterindex file gets closed.  There is a test that 
covers this case, so it leaks a file handle when that test runs.  On Windows, 
this ultimately causes tests to fail during their post-test cleanup, because 
Windows file locking behavior causes the delete to fail.
                
> TestHarFileSystemBasics fails on Windows due to invalid HAR URI and file 
> handle leak
> ------------------------------------------------------------------------------------
>
>                 Key: HADOOP-9278
>                 URL: https://issues.apache.org/jira/browse/HADOOP-9278
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs, test
>    Affects Versions: 3.0.0
>            Reporter: Chris Nauroth
>            Assignee: Chris Nauroth
>
> We need to change the tests to use valid HAR URIs and fix the file handle 
> leak.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to