Repository: apache/dubbo
File: dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/AbstractNettyConnectionClient.java (Java)

Code before:
                return;
            }
            AbstractNettyConnectionClient connectionClient = AbstractNettyConnectionClient.this;
            if (connectionClient.isClosed() || connectionClient.getCounter() == 0) {
                if (logger.isDebugEnabled()) {
                    logger.debug(
                            "Connection:{} aborted to reconnect. {}",
                            connectionClient,
                            future.cause().getMessage());
                }
                return;
            }
            if (logger.isDebugEnabled()) {
                logger.debug(
                        "Connection:{} is reconnecting, attempt=0 cause={}",
                        connectionClient,
                        future.cause().getMessage());
            }

            // Notify the connection is unavailable.
            disconnectedPromise.trySuccess(null);

            connectivityExecutor.schedule(
                    () -> {
                        try {
                            doConnect();
                        } catch (RemotingException e) {
                            logger.error(
                                    TRANSPORT_FAILED_RECONNECT,
                                    "",
                                    "",
                                    "Failed to connect to server: " + getConnectAddress());
                        }
                    },
                    reconnectDuration,
                    TimeUnit.MILLISECONDS);
        }
    }
}


Review comment (suggestion):
The change from `doReconnect()` to `doConnect()` may alter the reconnection behavior. `doReconnect()` likely contains reconnection-specific logic that differs from the initial connection logic in `doConnect()`. Consider verifying that `doConnect()` handles reconnection scenarios appropriately or restore the use of `doReconnect()`.
```suggestion
                            doReconnect();
```

Code after:
        @Override
        public void operationComplete(ChannelFuture future) {
            if (!isReconnecting.compareAndSet(true, false)) {
                return;
            }
            if (future.isSuccess()) {
                return;
            }
            AbstractNettyConnectionClient connectionClient = AbstractNettyConnectionClient.this;
            if (connectionClient.isClosed() || connectionClient.getCounter() == 0) {
                if (logger.isDebugEnabled()) {
                    logger.debug(
                            "Connection:{} aborted to reconnect. {}",
                            connectionClient,
                            future.cause().getMessage());
                }
                return;
            }
            if (logger.isDebugEnabled()) {
                logger.debug(
                        "Connection:{} is reconnecting, attempt=0 cause={}",
                        connectionClient,
                        future.cause().getMessage());
            }

            // Notify the connection is unavailable.
            disconnectedPromise.trySuccess(null);

            scheduleReconnect(reconnectDuration, TimeUnit.MILLISECONDS);
        }
    }
}