From 71f746accedfb6138636caae48173bea147a0698 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 a08d095d3fe..1c266d32f82 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 @@ -218,9 +218,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