-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[fix][broker] Fix potential NPE when disabling the liveness check #21840
Conversation
@mattisonchao Please add the following content to your PR description and select a checkbox:
|
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.
Just want to make sure. The NPE will only be thrown here:
pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractTopic.java
Line 971 in c4cff0a
if (previousIsActive) { |
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.
I think that there was a reason to return null when this was implemented. Please postpone merging until I have reviewed this.
@mattisonchao is there a way to have a test case for this? |
I don't think we need this kind of test, the method should return |
LGTM, but also need to remove the null checker? |
I now had a chance to review the reason why I had originally used pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/TransportCnx.java Lines 80 to 87 in c4cff0a
I'll suggest that we change the return value from |
ok, then we find a new place need to fix to avoid NPE pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractTopic.java Lines 958 to 979 in cea5c93
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #21840 +/- ##
============================================
- Coverage 73.66% 73.60% -0.07%
+ Complexity 32343 32321 -22
============================================
Files 1858 1858
Lines 138146 138174 +28
Branches 15141 15148 +7
============================================
- Hits 101763 101699 -64
- Misses 28544 28606 +62
- Partials 7839 7869 +30
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Hi, @lhotari @Technoboy-
|
@mattisonchao I disagree. That would be bad API design. There might be future use cases where this matters. |
Motivation
Fix potential NPE when disabling the liveness check
Modifications
Verifying this change
Documentation
doc
doc-required
doc-not-needed
doc-complete