[ https://issues.apache.org/jira/browse/HBASE-25195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17216113#comment-17216113 ]
Reid Chan commented on HBASE-25195: ----------------------------------- branch-2+ don't have this issue. > [branch-1] getNumOpenConnections is not effective > ------------------------------------------------- > > Key: HBASE-25195 > URL: https://issues.apache.org/jira/browse/HBASE-25195 > Project: HBase > Issue Type: Improvement > Components: metrics > Environment: In MetricsHBaseServerWrapperImpl > {code} > @Override > public int getNumOpenConnections() { > if (!isServerStarted() || this.server.connectionList == null) { > return 0; > } > return server.connectionList.size(); > } > {code} > But connectionList is created by Collections.synchronizedList(new > LinkedList<Connection>()); > So each connectionList.size() will compete for the mutex, we can easily > replace it with another parameter *numConnections*, as for metrics, it is > enough. > Reporter: Reid Chan > Assignee: Reid Chan > Priority: Minor > Fix For: 1.7.0 > > -- This message was sent by Atlassian Jira (v8.3.4#803005)