[
https://issues.apache.org/jira/browse/HDFS-15757?focusedWorklogId=546625&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-546625
]
ASF GitHub Bot logged work on HDFS-15757:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 03/Feb/21 01:23
Start Date: 03/Feb/21 01:23
Worklog Time Spent: 10m
Work Description: fengnanli commented on a change in pull request #2651:
URL: https://github.com/apache/hadoop/pull/2651#discussion_r568866912
##########
File path:
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/ConnectionPool.java
##########
@@ -252,19 +252,23 @@ public synchronized void addConnection(ConnectionContext
conn) {
*/
public synchronized List<ConnectionContext> removeConnections(int num) {
List<ConnectionContext> removed = new LinkedList<>();
-
- // Remove and close the last connection
- List<ConnectionContext> tmpConnections = new ArrayList<>();
- for (int i=0; i<this.connections.size(); i++) {
- ConnectionContext conn = this.connections.get(i);
- if (i < this.minSize || i < this.connections.size() - num) {
- tmpConnections.add(conn);
- } else {
- removed.add(conn);
+ if (this.connections.size() > this.minSize) {
+ int targetCount = Math.min(num, this.connections.size() - this.minSize);
Review comment:
I don't think it can negative here since the only place connections
become less is in this function at the swap part with the tmpConnections. The
other place where this var gets assigned is in the creation part and it can
only increase the value.
##########
File path:
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/ConnectionContext.java
##########
@@ -57,6 +62,17 @@ public synchronized boolean isActive() {
return this.numThreads > 0;
}
+ /**
+ * Check if the connection is/was active recently.
+ *
+ * @return True if the connection is active or
+ * was active in the past period of time.
+ */
+ public synchronized boolean isActiveRecently() {
+ return isActive() ||
Review comment:
That can removed since the timewindow calculation covers the active
case. Updated.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 546625)
Time Spent: 3h 10m (was: 3h)
> RBF: Improving Router Connection Management
> -------------------------------------------
>
> Key: HDFS-15757
> URL: https://issues.apache.org/jira/browse/HDFS-15757
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: rbf
> Reporter: Fengnan Li
> Assignee: Fengnan Li
> Priority: Major
> Labels: pull-request-available
> Attachments: RBF_ Improving Router Connection Management_v2.pdf, RBF_
> Improving Router Connection Management_v3.pdf, RBF_ Router Connection
> Management.pdf
>
> Time Spent: 3h 10m
> Remaining Estimate: 0h
>
> We have seen high number of connections from Router to namenodes, leaving
> namenodes unstable.
> This ticket is trying to reduce connections through some changes. Please take
> a look at the design and leave comments.
> Thanks!
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]