yx9o commented on code in PR #11044:
URL: https://github.com/apache/rocketmq/pull/11044#discussion_r4376920434
##########
namesrv/src/main/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManager.java:
##########
@@ -819,11 +870,14 @@ public void scanNotActiveBroker() {
public void onChannelDestroy(BrokerAddrInfo brokerAddrInfo) {
UnRegisterBrokerRequestHeader unRegisterRequest = new
UnRegisterBrokerRequestHeader();
+ Channel expectedChannel = null;
boolean needUnRegister = false;
if (brokerAddrInfo != null) {
try {
try {
this.lock.readLock().lockInterruptibly();
+ BrokerLiveInfo brokerLiveInfo =
this.brokerLiveTable.get(brokerAddrInfo);
+ expectedChannel = brokerLiveInfo != null ?
brokerLiveInfo.getChannel() : null;
Review Comment:
Could we pass the expired channel from the scan instead of looking it up
again? A broker may re-register in between, causing this lookup to capture the
new channel and the stale cleanup to unregister it.
--
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]