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

Xiaobing Zhou updated HDFS-8855:
--------------------------------
    Attachment: HDFS-8855.2.patch

Made patch V2. The proposed fix is to cache UGI in webhdfs to avoid creating 
brand new UGI for every web request.
1. In insecure case, remote-user+proxy-user is the key for cache. 
2. In secure case, token is the key. UGI is constructed based on token. It’s 
necessary to ensure different UGI instance, and thus different connection, 
given token is changed.

Connection cache is designed to be keyed on UGI instances. Actually, the 
connection cache is keyed on the 'UGI#Subject' instance instead of the UGI 
instance, which seems to be the right choice because subject contains the 
security credentials of the users, and we should allow connection re-use in the 
same authentication context only.


> Webhdfs client leaks active NameNode connections
> ------------------------------------------------
>
>                 Key: HDFS-8855
>                 URL: https://issues.apache.org/jira/browse/HDFS-8855
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: webhdfs
>         Environment: HDP 2.2
>            Reporter: Bob Hansen
>            Assignee: Xiaobing Zhou
>         Attachments: HDFS-8855.1.patch, HDFS-8855.2.patch, 
> HDFS_8855.prototype.patch
>
>
> The attached script simulates a process opening ~50 files via webhdfs and 
> performing random reads.  Note that there are at most 50 concurrent reads, 
> and all webhdfs sessions are kept open.  Each read is ~64k at a random 
> position.  
> The script periodically (once per second) shells into the NameNode and 
> produces a summary of the socket states.  For my test cluster with 5 nodes, 
> it took ~30 seconds for the NameNode to have ~25000 active connections and 
> fails.
> It appears that each request to the webhdfs client is opening a new 
> connection to the NameNode and keeping it open after the request is complete. 
>  If the process continues to run, eventually (~30-60 seconds), all of the 
> open connections are closed and the NameNode recovers.  
> This smells like SoftReference reaping.  Are we using SoftReferences in the 
> webhdfs client to cache NameNode connections but never re-using them?



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

Reply via email to