hanpen24 commented on code in PR #13904:
URL: https://github.com/apache/dubbo/pull/13904#discussion_r1523487584
##########
dubbo-remoting/dubbo-remoting-netty4/src/main/java/org/apache/dubbo/remoting/transport/netty4/NettyConnectionClient.java:
##########
@@ -361,21 +360,14 @@ public void operationComplete(ChannelFuture future) {
"%s is reconnecting, attempt=%d cause=%s",
connectionClient, 0, future.cause().getMessage()));
}
- final EventLoop loop = future.channel().eventLoop();
- loop.schedule(
- () -> {
- try {
- connectionClient.doConnect();
- } catch (RemotingException e) {
- LOGGER.error(
- TRANSPORT_FAILED_RECONNECT,
- "",
- "",
- "Failed to connect to server: " +
getConnectAddress());
- }
- },
- 1L,
- TimeUnit.SECONDS);
+ executor.submit(() -> {
Review Comment:
Thank you very much.
I resolved the error by defining the ExecutorService within the method.
However, a new error has occurred, so I will check it.
Considering the current modification, instantiating it inside the method
might be costly. Would it be better to have an instance of the
ExecutorRepository class as a field in the NettyConnectionClient class?
--
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]