Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE #7509] Optimize updateTopicRouteInfoFromNameServer #7510

Closed
wants to merge 5 commits into from

Conversation

drpmma
Copy link
Contributor

@drpmma drpmma commented Oct 27, 2023

Which Issue(s) This PR Fixes

To throw the specific exception to the upper level with more information.

Fixes #7509

Brief Description

  • Throw MQClientException for updateTopicRouteInfoFromNameServer

  • Add compatible updateTopicRouteInfoFromNameServerWithoutException method

How Did You Test This Change?

* Throw MQClientException for updateTopicRouteInfoFromNameServer

* Add compatible updateTopicRouteInfoFromNameServerWithoutException method
@@ -785,6 +793,7 @@ public boolean updateTopicRouteInfoFromNameServer(final String topic, boolean is
if (!topic.startsWith(MixAll.RETRY_GROUP_TOPIC_PREFIX) && !topic.equals(TopicValidator.AUTO_CREATE_TOPIC_KEY_TOPIC)) {
log.warn("updateTopicRouteInfoFromNameServer Exception", e);
}
throw e;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

先log再throw的写法可能会造成上层出现重复打印error的情况

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里是为了尽可能和之前的行为保持一致,如果去掉的话,可能会导致原先打印的日志无法被打印出来。

@codecov-commenter
Copy link

codecov-commenter commented Oct 30, 2023

Codecov Report

Merging #7510 (01b16c9) into develop (48ef5ce) will increase coverage by 0.00%.
Report is 1 commits behind head on develop.
The diff coverage is 28.57%.

@@            Coverage Diff             @@
##             develop    #7510   +/-   ##
==========================================
  Coverage      43.01%   43.01%           
+ Complexity      9685     9683    -2     
==========================================
  Files           1158     1158           
  Lines          83977    83981    +4     
  Branches       10915    10915           
==========================================
+ Hits           36122    36124    +2     
- Misses         43362    43363    +1     
- Partials        4493     4494    +1     
Files Coverage Δ
...e/rocketmq/client/impl/consumer/RebalanceImpl.java 31.56% <ø> (+0.21%) ⬆️
...mq/client/impl/producer/DefaultMQProducerImpl.java 44.90% <ø> (ø)
...he/rocketmq/client/trace/AsyncTraceDispatcher.java 82.46% <ø> (ø)
...ent/impl/consumer/DefaultLitePullConsumerImpl.java 68.00% <0.00%> (+0.46%) ⬆️
...lient/impl/consumer/DefaultMQPushConsumerImpl.java 33.58% <0.00%> (ø)
...rocketmq/client/impl/factory/MQClientInstance.java 46.56% <40.00%> (+0.33%) ⬆️

... and 19 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@joeCarf joeCarf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@drpmma drpmma closed this Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimize updateTopicRouteInfoFromNameServer
3 participants