-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[improve][doc] Improve the JavaDocs of sendAsync to avoid improper use #24601
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][doc] Improve the JavaDocs of sendAsync to avoid improper use #24601
Conversation
lhotari
left a comment
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.
I think that there's a similar "feature" in using most async APIs of the Pulsar Java client. Would you mind checking other async methods? However, I guess sendAsync is the most commonly used async API since without using it, it's not possible to benefit from batching in many applications.
|
Yes, Currently a
As you can see, transaction metadata processing could be affected. But I think it's because executors are used without any careful consideration. Before adding documents, we might need to think if the existing behavior should be documented. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #24601 +/- ##
============================================
+ Coverage 74.21% 74.26% +0.04%
+ Complexity 33142 33132 -10
============================================
Files 1881 1881
Lines 146770 146776 +6
Branches 16859 16859
============================================
+ Hits 108922 108998 +76
+ Misses 29181 29112 -69
+ Partials 8667 8666 -1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
apache#24601) (cherry picked from commit dedba1a)
apache#24601) (cherry picked from commit dedba1a) (cherry picked from commit 69c7d66)
apache#24601) (cherry picked from commit dedba1a) (cherry picked from commit 69c7d66)
apache#24601) (cherry picked from commit dedba1a) (cherry picked from commit 687c1b7)
apache#24601) (cherry picked from commit dedba1a) (cherry picked from commit 687c1b7)
Motivation
It's never documented that the future of
sendAsyncis called in a single I/O thread. Without knowing it, it would be very easy to usesendAsyncimproperly, which might affect other producers or consumers in the same client, or even lead to deadlocks.Modifications
Improve the JavaDocs of
Producer#sendAsync.Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: