AlbumenJ commented on code in PR #15209:
URL: https://github.com/apache/dubbo/pull/15209#discussion_r1988266175
##########
dubbo-remoting/dubbo-remoting-netty/src/main/java/org/apache/dubbo/remoting/transport/netty/NettyClient.java:
##########
@@ -86,79 +88,100 @@ public ChannelPipeline getPipeline() {
@Override
protected void doConnect() throws Throwable {
long start = System.currentTimeMillis();
- ChannelFuture future = bootstrap.connect(getConnectAddress());
+ InetSocketAddress connectAddress = getConnectAddress();
+ ChannelFuture future = bootstrap.connect(connectAddress);
+ long connectTimeout = getConnectTimeout();
+ long deadline = start + connectTimeout;
try {
- boolean ret = future.awaitUninterruptibly(getConnectTimeout(),
TimeUnit.MILLISECONDS);
-
- if (ret && future.isSuccess()) {
- Channel newChannel = future.getChannel();
- newChannel.setInterestOps(Channel.OP_READ_WRITE);
- try {
- // Close old channel
- Channel oldChannel = NettyClient.this.channel; // copy
reference
- if (oldChannel != null) {
- try {
- if (logger.isInfoEnabled()) {
- logger.info("Close old netty channel " +
oldChannel + " on create new netty channel "
- + newChannel);
+ while (true) {
Review Comment:
we should limit the maximum times here
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]