From 843cc5f952613f0e43b18d3789eb91c120b8d7d1 Mon Sep 17 00:00:00 2001 From: mrzhao Date: Wed, 16 Nov 2022 14:51:55 +0800 Subject: [PATCH] HBASE-27379 fix numOpenConnections metric is one less than the actual (#4884) Signed-off-by: Duo Zhang (cherry picked from commit d7c4447dd2c14bec591597a74f043b36f35bd6a3) --- .../main/java/org/apache/hadoop/hbase/ipc/NettyRpcServer.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcServer.java index 002c5a2d488..81fe7cc7018 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcServer.java @@ -183,9 +183,7 @@ public class NettyRpcServer extends RpcServer { @Override public int getNumOpenConnections() { - int channelsCount = allChannels.size(); - // allChannels also contains the server channel, so exclude that from the count. - return channelsCount > 0 ? channelsCount - 1 : channelsCount; + return allChannels.size(); } @Override