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

Hong Tang commented on HADOOP-4655:
-----------------------------------

In most situations cache is useful. But I don't like the fact that currently 
all concrete FileSystem implementations must call super.close(). From API 
symmetry point of view, if you get a FileSystem instance through 
FS.newInstance(), then you are responsible for calling fs.close(); or if you 
get an instance from cache as in FS.get(), you should call something like 
FS.return() instead of fs.close(). If this is enforced, then we can ref-count 
the CACHE, and FileSystem.close() should not deal with CACHE at all.

> FileSystem.CACHE should be ref-counted
> --------------------------------------
>
>                 Key: HADOOP-4655
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4655
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: dfs, fs
>    Affects Versions: 0.18.1, 0.18.2, 0.19.0, 0.19.1, 0.20.0
>            Reporter: Hong Tang
>            Assignee: dhruba borthakur
>         Attachments: FileSystemUnique.patch
>
>
> FileSystem.CACHE is not ref-counted, and could lead to resource leakage.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to