In NettyRpcServer, numOpenConnections metric is set to -1 when zero server channel exist.
@Override public int getNumOpenConnections() { // allChannels also contains the server channel, so exclude that from the count. return allChannels.size() - 1; }
We should not decrease the channel size by 1 when zero server channel exist.