You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Moran (Jira)" <ji...@apache.org> on 2022/11/16 02:50:00 UTC

[jira] (HBASE-27379) numOpenConnections metric is one less than the actual

    [ https://issues.apache.org/jira/browse/HBASE-27379 ]


    Moran deleted comment on HBASE-27379:
    -------------------------------

was (Author: mrzhao):
fix in https://github.com/apache/hbase/pull/4884

> 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
>            Priority: Minor
>
> 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)