Anon2Tokyo commented on code in PR #8199:
URL: https://github.com/apache/incubator-seata/pull/8199#discussion_r3845039309
##########
core/src/main/java/org/apache/seata/core/rpc/netty/AbstractNettyRemotingClient.java:
##########
@@ -89,6 +93,15 @@ public abstract class AbstractNettyRemotingClient extends
AbstractNettyRemoting
private static final long SCHEDULE_DELAY_MILLS = 60 * 1000L;
private static final long SCHEDULE_INTERVAL_MILLS = 10 * 1000L;
private static final String MERGE_THREAD_PREFIX = "rpcMergeMessageSend";
+ private static final Object RECONNECT_TASK_LOCK = new Object();
+ private static final ScheduledThreadPoolExecutor RECONNECT_EXECUTOR =
+ new ScheduledThreadPoolExecutor(1, new
NamedThreadFactory("NettyClientReconnectTimer", true));
Review Comment:
Good catch. reconnect() can perform blocking connection attempts, so running
RM/TM reconnect callbacks on a single scheduled thread can introduce cross-role
recovery delay.
I will update this so the scheduler only triggers reconnect work, while the
blocking reconnect execution runs on a separate worker executor. I will also
guard each client with an in-flight flag to avoid overlapping reconnect
attempts for the same client.
--
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]