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 block while acquiring channels, so executing
the reconnect body directly on a single scheduler thread can delay reconnect
triggering for other clients/roles.
I will keep the scheduler shared to address #5338, but change it so the
scheduler only triggers reconnect checks. The actual reconnect work will be
dispatched to a separate worker executor, with a per-client in-flight guard 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]