Fix netty close when init count is 0 (#12737)

This commit is contained in:
Albumen Kevin 2023-07-17 11:35:03 +08:00 committed by GitHub
parent bd76d044ba
commit 630e14ae40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -49,6 +49,9 @@ public abstract class AbstractConnectionClient extends AbstractClient {
protected AbstractConnectionClient(URL url, ChannelHandler handler) throws RemotingException {
super(url, handler);
}
public final void increase() {
COUNTER_UPDATER.set(this, 1L);
}

View File

@ -89,6 +89,7 @@ public class NettyConnectionClient extends AbstractConnectionClient {
this.channel = new AtomicReference<>();
this.closePromise = new DefaultPromise<>(GlobalEventExecutor.INSTANCE);
this.init = new AtomicBoolean(false);
this.increase();
}
@Override