starlight icon indicating copy to clipboard operation
starlight copied to clipboard

SingleChannle中getChannel是否会泄露连接?

Open Delostik opened this issue 5 years ago • 0 comments

请问BrpcSingleChannel中

public Channel getChannel() throws Exception, NoSuchElementException, IllegalStateException {
        if (isNonActive(channel)) {
            synchronized (this) {
                if (isNonActive(channel)) {
                    channel = createChannel(serviceInstance.getIp(), serviceInstance.getPort());
                }
            }
        }
        return channel;
    }

没看到有旧channel关闭的代码,是否会泄露?谢谢

Delostik avatar Oct 07 '20 11:10 Delostik