starlight icon indicating copy to clipboard operation
starlight copied to clipboard

BrpcSingleChannel 关闭后仍然会有重连操作

Open beihaifeiwu opened this issue 4 years ago • 0 comments

synchronized (channelGroup) {
                if (oldChannel != channelGroup.channel) {
                    return;
                }
                Channel newChannel = null;
                try {
                    newChannel = channelGroup.createChannel(
                            channelGroup.getServiceInstance().getIp(),
                            channelGroup.getServiceInstance().getPort());
                } catch (Exception e) {
                    log.info("failed reconnecting");
                }
                if (newChannel != null) {
                    channelGroup.updateChannel(newChannel);
                    if (oldChannel != null) {
                        oldChannel.close();
                    }
                }
            }

ReConnectTask 中未校验channelGroup是否已close, 服务端有大量节点存在时,关闭时会报大量重连失败的日志, 并且进程退出的时间也会延后(等待重连线程中的任务执行)

beihaifeiwu avatar Jan 20 '21 12:01 beihaifeiwu