fix: 修复broker集群宕机情况下,客户端刷新连接时,若各连接抛出异常时机不一致,则仍未抛出异常的连接uri无法加入unHealth… #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
版本:
1.1.5
部署情况:
三节点的Gossip广播模式集群部署。
缺陷现象描述:
broker三节点关停一段时间后启动,存在部分客户端无法全部自动注册上三个broker节点。
异常类:
com.alibaba.rsocket.loadbalance.LoadBalancedRSocket
问题原因:

在所有节点关停后,客户端中维持的最后一条活跃连接触发onRSocketClosed,并将原始三节点uri进行refreshRsockets。这三条链接在connect或healthcheck阶段中会抛出连接相关异常,进而触发后续的异常处理流程;
但在此链接的异常处理流程执行完成前,若其余连接仍未抛出异常执行对应异常处理流程,则会被异常撤销流程,以至于无法加入unHealthyUriSet。故checkUnhealthyUris方法无法重连此异常链接。
处理思路:

在refreshRsockets方法中对connect及healthcheck阶段的异常进行捕获并不再抛出,返回空流。