-
Notifications
You must be signed in to change notification settings - Fork 11.7k
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 #8777] enhance error log when when can't connect to namesrv addrs #8778
base: develop
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #8778 +/- ##
==========================================
Coverage 47.37% 47.38%
+ Complexity 11558 11557 -1
==========================================
Files 1282 1282
Lines 89864 89864
Branches 11563 11563
==========================================
+ Hits 42575 42579 +4
+ Misses 42040 42032 -8
- Partials 5249 5253 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -839,8 +839,8 @@ public boolean updateTopicRouteInfoFromNameServer(final String topic, boolean is | |||
log.warn("updateTopicRouteInfoFromNameServer Exception", e); | |||
} | |||
} catch (RemotingException e) { | |||
log.error("updateTopicRouteInfoFromNameServer Exception", e); | |||
throw new IllegalStateException(e); | |||
log.error("updateTopicRouteInfoFromNameServer Exception, namesrvAddr: " + clientConfig.getNamesrvAddr(), e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please log with formatter, not string concatenation. See https://medium.com/@mohanakrishnakavali/logging-efficiency-in-java-string-concatenation-vs-string-format-efa02055ddae
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This errorMessage string is always being constructed. How about if I change it to the following code?
String errorMessage = String.format("updateTopicRouteInfoFromNameServer Exception, namesrvAddr: %s", clientConfig.getNamesrvAddr());
log.error(errorMessage, e);
throw new IllegalStateException(errorMessage, e);
Which Issue(s) This PR Fixes
Fixes #8777
Brief Description
How Did You Test This Change?