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

Vinayakumar B commented on HDFS-8332:
-------------------------------------

Hi [~busbey],
I understand that Tests started failing after the commit, that doesnt mean that 
this Jira change is incompatible.
Failure was due to the error in test, which was calling {{setReplication(..)}} 
even after {{fs.close()}}. of-course it was passing due to this bug. :)
Below code is from BaseTestHttpFSWith.java
{code}  private void testSetReplication() throws Exception {
    FileSystem fs = FileSystem.get(getProxiedFSConf());
    Path path = new Path(getProxiedFSTestDir(), "foo.txt");
    OutputStream os = fs.create(path);
    os.write(1);
    os.close();
    fs.close();
    fs.setReplication(path, (short) 2);

    fs = getHttpFSFileSystem();
    fs.setReplication(path, (short) 1);
    fs.close();

    fs = FileSystem.get(getProxiedFSConf());
    FileStatus status1 = fs.getFileStatus(path);
    fs.close();
    Assert.assertEquals(status1.getReplication(), (short) 1);
  }{code}
IMO, incompatible change is only when the user's valid code fails. Not when 
error code fails after change.

Agree?

> DFS client API calls should check filesystem closed
> ---------------------------------------------------
>
>                 Key: HDFS-8332
>                 URL: https://issues.apache.org/jira/browse/HDFS-8332
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Rakesh R
>            Assignee: Rakesh R
>             Fix For: 2.8.0
>
>         Attachments: HDFS-8332-000.patch, HDFS-8332-001.patch, 
> HDFS-8332-002-Branch-2.patch, HDFS-8332-002.patch, 
> HDFS-8332.001.branch-2.patch
>
>
> I could see {{listCacheDirectives()}} and {{listCachePools()}} APIs can be 
> called even after the filesystem close. Instead these calls should do 
> {{checkOpen}} and throws:
> {code}
> java.io.IOException: Filesystem closed
>       at org.apache.hadoop.hdfs.DFSClient.checkOpen(DFSClient.java:464)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to