maple525866 commented on code in PR #7783:
URL: https://github.com/apache/incubator-seata/pull/7783#discussion_r2527305777


##########
core/src/main/java/org/apache/seata/core/rpc/netty/AbstractNettyRemotingClient.java:
##########
@@ -96,6 +99,10 @@ public abstract class AbstractNettyRemotingClient extends 
AbstractNettyRemoting
     protected final Condition mergeCondition = mergeLock.newCondition();
     protected volatile boolean isSending = false;
 
+    private final Runnable reconnectTask;
+    private ScheduledExecutorService reconnectTimer;

Review Comment:
   It's probably better to have a globally unique one here, otherwise there 
would be multiple reconnectTimers.



##########
core/src/main/java/org/apache/seata/core/rpc/netty/AbstractNettyRemotingClient.java:
##########
@@ -271,6 +287,11 @@ public void destroyChannel(String serverAddress, Channel 
channel) {
 
     @Override
     public void destroy() {
+        if (reconnectTimer != null && timerStarted.get()) {
+            reconnectTimer.shutdown();

Review Comment:
   When reconnectTimer runs shutdown(), it does not interrupt ongoing tasks, 
which means that reconnection may still occur after destruction.



-- 
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]

Reply via email to