Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Feedback Received
-
4.0.0-incubating
-
None
Description
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()); } } }
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