You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@rocketmq.apache.org by "yukon (JIRA)" <ji...@apache.org> on 2017/04/20 06:26:04 UTC
[jira] [Assigned] (ROCKETMQ-167) namesrv RouteInfoManager
scanNotActiveBroker have the Thread competition
[ https://issues.apache.org/jira/browse/ROCKETMQ-167?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
yukon reassigned ROCKETMQ-167:
------------------------------
Assignee: yukon (was: Xiaorui Wang)
> namesrv RouteInfoManager scanNotActiveBroker have the Thread competition
> -------------------------------------------------------------------------
>
> Key: ROCKETMQ-167
> URL: https://issues.apache.org/jira/browse/ROCKETMQ-167
> Project: Apache RocketMQ
> Issue Type: Bug
> Components: rocketmq-namesrv
> Affects Versions: 4.0.0-incubating
> Reporter: zhaoziyan
> Assignee: yukon
> Fix For: 4.2.0-incubating
>
>
> {code}
> public void scanNotActiveBroker() {
> Iterator<Entry<String, BrokerLiveInfo>> it = this.brokerLiveTable.entrySet().iterator();
> while (it.hasNext()) {
> Entry<String, BrokerLiveInfo> next = it.next();
> long last = next.getValue().getLastUpdateTimestamp();
> if ((last + BROKER_CHANNEL_EXPIRED_TIME) < System.currentTimeMillis()) {
> RemotingUtil.closeChannel(next.getValue().getChannel());
> it.remove();
> log.warn("The broker channel expired, {} {}ms", next.getKey(), BROKER_CHANNEL_EXPIRED_TIME);
> this.onChannelDestroy(next.getKey(), next.getValue().getChannel());
> }
> }
> }
> {code}
> scanNotActiveBroker dont have the writelock ,but it is modify the brokerLiveTable and Iterator the brokerLiveTable .
> NSScheduledThread and nettyeventExcutor Thread have the competition.
> The scanNotActiveBroker may throw
> java.util.ConcurrentModificationException: null
> and nevel run again
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)