sohutv / sohutv/mqcloud

当对topic进行消息查询后,如果删除该topic,日志会出现大量MQClientException错误

Open
#20 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
2.2k
Forks
285
PR merge metrics
No merged PRs in 30d

Description

场景:当在mqcloud上对某个topic进行消息查询后,此时若删除该topic,会导致在MQClientInstance的定时任务updateTopicRouteInfoFromNameServer出现大量WARNING日志;
原因个人分析,由于使用mqAdmin对象池对topic进行查询时,会将topic信息保存到producerTable中,当删除该topic后,对象池中的producerTable不会同步删除该topic,导致后续定时任务更新topic信息一致报错,不知道上述分析是否正确,有什么解决方式没有?

2021-05-20 18:40:08.065 {MQClientFactoryScheduledThread} WARN RocketmqClient-115 - get Topic [*****_topic] RouteInfoFromNameServer is not exist value
2021-05-20 18:40:08.065 {MQClientFactoryScheduledThread} WARN RocketmqClient-130 - updateTopicRouteInfoFromNameServer Exception
org.apache.rocketmq.client.exception.MQClientException: CODE: 17 DESC: No topic route info in name server for the topic: *****_topic
See http://rocketmq.apache.org/docs/faq/ for further details.
at org.apache.rocketmq.client.impl.MQClientAPIImpl.getTopicRouteInfoFromNameServer(MQClientAPIImpl.java:1385)
at org.apache.rocketmq.client.impl.MQClientAPIImpl.getTopicRouteInfoFromNameServer(MQClientAPIImpl.java:1355)
at org.apache.rocketmq.client.impl.factory.MQClientInstance.updateTopicRouteInfoFromNameServer(MQClientInstance.java:622)
at org.apache.rocketmq.client.impl.factory.MQClientInstance.updateTopicRouteInfoFromNameServer(MQClientInstance.java:509)
at org.apache.rocketmq.client.impl.factory.MQClientInstance.updateTopicRouteInfoFromNameServer(MQClientInstance.java:358)
at org.apache.rocketmq.client.impl.factory.MQClientInstance$3.run(MQClientInstance.java:275)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with MQClientInstance.updateTopicRouteInfoFromNameServer and the related calls in MQClientAPIImpl.java shown in the stack trace. Inspect how mqAdmin queries store topic information in the producerTable and what happens after the topic is deleted. Done means determining the cause and preventing the repeated MQClientException warnings, with a regression check for this sequence.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.