-
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
[improve][broker] Refactor a private method to eliminate an unnecessary parameter #23904
base: master
Are you sure you want to change the base?
Conversation
if (permits.intValue() > 0) { | ||
boolean canDispatchEntry = canDispatchEntry(consumer, entry, readType, stickyKeyHash); | ||
if (!canDispatchEntry) { | ||
blockedByHash.setTrue(); |
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.
There needs to be a null check here.
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 take a look again @lhotari
boolean canDispatchEntry = canDispatchEntry(consumer, entry, readType, stickyKeyHash); | ||
if (!canDispatchEntry) { | ||
if(blockedByHash != null){ | ||
blockedByHash.setTrue(); | ||
} | ||
// decrement the permits for the consumer | ||
permits.decrement(); | ||
// allow the entry to be dispatched | ||
dispatchEntry = true; | ||
} |
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 logic is not correct. Do you spot the problem?
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.
Could you explain it in detail? @lhotari
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.
For effective contributions, it is necessary to run tests and use tests to provide feedback. Did you check my previous advice about Personal CI? When you know what tests fail, you can then locally run a single unit test in your IDE. Have you already tried this?
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 follow instructions to first get a CI pass with "Personal CI" in your forked repository: https://pulsar.apache.org/contribute/personal-ci/ . You will be able to get automated CI feedback on your own without requiring assistance from Pulsar contributors. It's necessary to latest changes from master branch to get most recent CI fixes. We have a lot of flaky tests, so some test failures could be flaky ones. Rerun failed builds in GitHub Actions CI if this happens. In your personal CI you will have full control.
Motivation
Modifications
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: guan46#1