15712852007 opened a new issue, #4561:
URL: https://github.com/apache/rocketmq/issues/4561

   
   <img width="1132" alt="WechatIMG4508" 
src="https://user-images.githubusercontent.com/41977714/177307478-bbcf6898-ea9c-44ff-8848-c21e15418717.png";>
   
   问题:
   
updateTopicRouteInfoFromNameServer在某些场景下lockNamesrv代码块的内部缺少校验,可能会导致RemotingTooMuchRequestException("sendDefaultImpl
 call timeout")异常。
   
   描述:
   
生产者发送消息时,会通过tryToFindTopicPublishInfo获取路由信息,如果没有缓存或没有messageQueue时会调用updateTopicRouteInfoFromNameServer向nameServer查询该topic的路由信息,在此方法内部有一个nameServer锁,这里极端情况下会出现一些问题,如果在同一时刻有很多个线程排队取lockNamesrv锁,假如前面的线程已通过nameServer拉取到路由信息了,在释放锁之后,后续的线程是没有必要重复与nameServer数据交互的,在网络不好等情况下很可能造成后面排队的线程超时(默认值3s),然后抛throw
 new RemotingTooMuchRequestException("sendDefaultImpl call 
timeout")异常。举个较为极端的例子:100个线程使用同一个producer,大家都第一次发送某个topic的消息。
   
   


-- 
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]

Reply via email to