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 reconnect task only by TransactionRole is too coarse. The
current implementation can skip reconnect scheduling for a second live client
with the same role, and destroying the owner client can cancel reconnects while
another client is still active.
I will change the lifecycle to be client-instance based: each
AbstractNettyRemotingClient owns its own scheduled reconnect future and cancels
only its own task during destroy(). This avoids dropping same-role clients and
avoids 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]