Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-27379

numOpenConnections metric is one less than the actual

    XMLWordPrintableJSON

Details

    • Reviewed

    Description

      In HBASE-17263,serverChannel add to allChannels,so NumOpenConnections exclude serverChannel from the count.

      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;
      }

      In HBASE-17263,serverChannel not add to allChannels,so NumOpenConnections  is one less than the actual.

      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());
        }
        ...
      } 

      In HBASE-21610, I think it's actually influenced by this bug.
       

      Attachments

        Issue Links

          Activity

            People

              mrzhao Moran
              mrzhao Moran
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: