[fix][broker] Log pulsar service config except sensitive info at startup#18179
Conversation
|
@zhaohaidao Please add the following content to your PR description and select a checkbox: |
|
rerun failure checks |
b8913c8 to
b3dc795
Compare
b3dc795 to
ac79fb8
Compare
| ) | ||
| private List<String> bootstrapNamespaces = new ArrayList<String>(); | ||
|
|
||
| @ToString.Exclude |
There was a problem hiding this comment.
I wonder why this lombok anonotion can not take affect
There was a problem hiding this comment.
The current implementation uses ReflectionToStringBuilder to print the serialized result. If I understand correctly, ReflectionToStringBuilder.toString(config) does not recognize lombok's annotations, we need to use the corresponding annotations to filter privacy information, namely StringToExclude instead of lombok's String.ToExclude
... Alternatively the ToStringExclude annotation can be used to exclude fields from being incorporated in the result. ... public class ReflectionToStringBuilder extends ToStringBuilder { ...
There was a problem hiding this comment.
Thanks for your explain. now I see it. The root cause is that we didn't over write toString() method of ServiceConfiguration.
How about just change it like this:
@ToString
@Getter
@Setter
public class ServiceConfiguration
or
@Data
public class ServiceConfiguration
because it looks that we need the toString() method.
There was a problem hiding this comment.
Thanks for your advice. I tried to add ToString annotation and it works as you expected.
I'm not sure if @DaTa is ok as it is equivalent to @Getter @Setter @requiredargsconstructor @tostring @EqualsAndHashCode.
If I understand correctly. We just need@Getter @Setter and @tostring only.
|
rerun failure checks |
|
/pulsarbot rerun-failure-checks |
|
@AnonHxy @codelipenghui This pr passes all the tests in my repo. Please have a look if you have time. Thanks |
Codecov Report
@@ Coverage Diff @@
## master #18179 +/- ##
============================================
+ Coverage 34.91% 38.92% +4.00%
- Complexity 5707 8283 +2576
============================================
Files 607 683 +76
Lines 53396 67268 +13872
Branches 5712 7214 +1502
============================================
+ Hits 18644 26183 +7539
- Misses 32119 38072 +5953
- Partials 2633 3013 +380
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Motivation
Printing service configuration at startup can help us effectively troubleshoot problems, but after #14421, the configuration at startup is no longer displayed.
According to the analysis, #14421 is mainly to avoid printing private information, such as passwords, rather than the entire configuration
Modifications
Log pulsar service config except sensitive info at startup
Verifying this change
Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: