HBASE-21610, numOpenConnections metric is set to -1 when zero server channel exist
This commit is contained in:
parent
83e12153d1
commit
f47761f91c
|
@ -169,8 +169,9 @@ 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 allChannels.size() - 1;
|
||||
return channelsCount > 0 ? channelsCount - 1 : channelsCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue