Anon2Tokyo commented on code in PR #8199:
URL: https://github.com/apache/incubator-seata/pull/8199#discussion_r3845041011


##########
core/src/main/java/org/apache/seata/core/rpc/netty/AbstractNettyRemotingClient.java:
##########
@@ -145,6 +148,38 @@ public void init() {
         clientBootstrap.start();
     }
 
+    private void scheduleReconnectTask() {
+        ReconnectTaskHolder taskHolder = RECONNECT_TASKS.get(transactionRole);
+        if (taskHolder != null && !taskHolder.future.isCancelled() && 
!taskHolder.future.isDone()) {
+            return;

Review Comment:
   Agreed. Keying the holder by `TransactionRole` while storing only the first 
client is too coarse. It can skip reconnect handling for later same-role 
clients, and destroying the owner client can cancel reconnect handling while 
another same-role client is still alive.
   
   I will change this to a shared reconnect scheduler with client registration. 
Each live client will be registered/unregistered independently, and the shared 
scheduled task will iterate the live clients and dispatch reconnect work for 
each one. This keeps the original goal of #5338, while avoiding dropped clients 
and cross-client cancellation.



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