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

Íñigo Goiri commented on HDFS-13230:
------------------------------------

Thanks [~csun] for [^HDFS-13230.000.patch].
 Can we leave {{cleanup()}} in the same area it was to be able to compare the 
chances easily?

For reference, this was added in HDFS-11546.
{quote}in the cleanup method, why we only remove 1 connection every time?
{quote}
We just wanted to be conservative and remove one by one; no specific reason 
other than being conservative.
{quote}it seems removeConnection will just pick the last connection to close, 
without considering whether it is closed or active, is there any reason for 
this?
{quote}
For the second question, the close is done asynchronously so we can just mark 
it as closed, and it will finish the request it's serving and closed afterwards.

> RBF: ConnectionManager's cleanup task will compare each pool's own active 
> conns with its total conns
> ----------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-13230
>                 URL: https://issues.apache.org/jira/browse/HDFS-13230
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>            Reporter: Wei Yan
>            Assignee: Chao Sun
>            Priority: Minor
>         Attachments: HDFS-13230.000.patch
>
>
> In the cleanup task:
> {code:java}
> long timeSinceLastActive = Time.now() - pool.getLastActiveTime();
> int total = pool.getNumConnections();
> int active = getNumActiveConnections();
> if (timeSinceLastActive > connectionCleanupPeriodMs ||
> {code}
> the 3rd line should be pool.getNumActiveConnections()
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to