You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Duo Zhang (Jira)" <ji...@apache.org> on 2022/11/16 09:27:00 UTC
[jira] [Resolved] (HBASE-27379) numOpenConnections metric is one less than the actual
[ https://issues.apache.org/jira/browse/HBASE-27379?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Duo Zhang resolved HBASE-27379.
-------------------------------
Fix Version/s: 2.6.0
3.0.0-alpha-4
2.5.2
2.4.16
Hadoop Flags: Reviewed
Resolution: Fixed
Pushed to branch-2.4+.
Thanks [~mrzhao] for contributing!
> numOpenConnections metric is one less than the actual
> ------------------------------------------------------
>
> Key: HBASE-27379
> URL: https://issues.apache.org/jira/browse/HBASE-27379
> Project: HBase
> Issue Type: Bug
> Components: metrics
> Affects Versions: 2.0.0
> Reporter: Moran
> Assignee: Moran
> Priority: Minor
> Fix For: 2.6.0, 3.0.0-alpha-4, 2.5.2, 2.4.16
>
>
> In HBASE-17263,serverChannel add to allChannels,so NumOpenConnections exclude serverChannel from the count.
> {code:java}
> public NettyRpcServer(final Server server, final String name,
> final List<BlockingServiceAndInterface> services,
> final InetSocketAddress bindAddress, Configuration conf,
> RpcScheduler scheduler) throws IOException {
> super(server, name, services, bindAddress, conf, scheduler);
> ...
> try {
> serverChannel = bootstrap.bind(this.bindAddress).sync().channel();
> LOG.info("NettyRpcServer bind to address=" + serverChannel.localAddress()
> + ", hbase.netty.rpc.server.worker.count=" + workerCount
> + ", useEpoll=" + useEpoll);
> allChannels.add(serverChannel);
> } catch (InterruptedException e) {
> throw new InterruptedIOException(e.getMessage());
> }
> ...
> }
> @Override
> public int getNumOpenConnections() {
> // allChannels also contains the server channel, so exclude that from the count.
> return allChannels.size() - 1;
> }{code}
> In HBASE-17263,serverChannel not add to allChannels,so NumOpenConnections is one less than the actual.
> {code:java}
> public NettyRpcServer(Server server, String name, List<BlockingServiceAndInterface> services,
> InetSocketAddress bindAddress, Configuration conf, RpcScheduler scheduler)
> throws IOException {
> ...
> try {
> serverChannel = bootstrap.bind(this.bindAddress).sync().channel();
> LOG.info("NettyRpcServer bind to address=" + serverChannel.localAddress());
> } catch (InterruptedException e) {
> throw new InterruptedIOException(e.getMessage());
> }
> ...
> } {code}
> In HBASE-21610, I think it's actually influenced by this bug.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)