You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Hong Tang (JIRA)" <ji...@apache.org> on 2008/11/13 21:42:44 UTC

[jira] Commented: (HADOOP-4655) FileSystem.CACHE should be ref-counted

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

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

The following code will either result in resource leakage or invalid FileSystem object:

Path path;
 ...
FileSystem fs1 = path.getFileSystem(conf);
...
FileSystem fs2 = path.getFileSystem(conf);
// fs1 should be the same as fs2.
...

fs1.close();
...
FileSystem fs3 = path.getFileSystem(conf);
// fs3 would be a newly created FileSystem object (instead of reusing fs1).

Even worse, if the actual FileSystem implemnetation's close() actually invalidates the object (such as DistributedFileSystem), then fs2 would no longer usable after fs1.close().

This is probably related to HADOOP-319.


> FileSystem.CACHE should be ref-counted
> --------------------------------------
>
>                 Key: HADOOP-4655
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4655
>             Project: Hadoop Core
>          Issue Type: Bug
>            Reporter: Hong Tang
>
> 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.