[ 
https://issues.apache.org/jira/browse/HDFS-5211?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chris Nauroth updated HDFS-5211:
--------------------------------

    Attachment: HDFS-5211.1.patch

Here is a patch that switches the order of operations in 
{{DistributedFileSystem#close}}.  It calls the superclass to remove the cache 
entry first before closing the contained {{DFSClient}}.

I did a full test run, and the only failure was {{TestBalancerWithNodeGroup}}.  
This is unrelated, because the test is known to fail intermittently.

Here is the output from test-patch.  The Findbugs warnings are unrelated.  This 
patch only touches {{DistributedFileSystem#close}}, and none of the warnings 
were reported in that method.  BTW, I reported a bug in "ant test-patch" in 
HADOOP-9965, and the workaround is to revert HADOOP-9573 locally.

     [exec] -1 overall.  
     [exec] 
     [exec]     +1 @author.  The patch does not contain any @author tags.
     [exec] 
     [exec]     -1 tests included.  The patch doesn't appear to include any new 
or modified tests.
     [exec]                         Please justify why no tests are needed for 
this patch.
     [exec] 
     [exec]     +1 javadoc.  The javadoc tool did not generate any warning 
messages.
     [exec] 
     [exec]     +1 javac.  The applied patch does not increase the total number 
of javac compiler warnings.
     [exec] 
     [exec]     -1 findbugs.  The patch appears to introduce 22 new Findbugs 
(version 1.3.9) warnings.

                
> Race condition between DistributedFileSystem#close and FileSystem#close can 
> cause return of a closed DistributedFileSystem instance from the FileSystem 
> cache.
> --------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-5211
>                 URL: https://issues.apache.org/jira/browse/HDFS-5211
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: hdfs-client
>    Affects Versions: 1.2.1
>            Reporter: Chris Nauroth
>            Assignee: Chris Nauroth
>         Attachments: HDFS-5211.1.patch
>
>
> {{DistributedFileSystem#close}} closes the underlying {{DFSClient}} before 
> the superclass call to {{FileSystem#close}}, which removes the instance from 
> the cache.  This leaves a small window during which another thread can call 
> {{FileSystem#get}} and receive the closed instance from the cache.

--
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