-
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][client] fix incomingMessageSize and client memory usage is negative #23624
[fix][client] fix incomingMessageSize and client memory usage is negative #23624
Conversation
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, great work @TakaHiR07
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.
Nice catch, good work
pulsar-broker/src/test/java/org/apache/pulsar/client/impl/AutoScaledReceiverQueueSizeTest.java
Outdated
Show resolved
Hide resolved
463b90b
to
7d79851
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #23624 +/- ##
============================================
+ Coverage 73.57% 74.35% +0.78%
- Complexity 32624 34970 +2346
============================================
Files 1877 1944 +67
Lines 139502 147140 +7638
Branches 15299 16224 +925
============================================
+ Hits 102638 109409 +6771
- Misses 28908 29282 +374
- Partials 7956 8449 +493
Flags with carried forward coverage won't be shown. Click here to find out more.
|
…tive (apache#23624) Co-authored-by: fanjianye <fanjianye@bigo.sg> (cherry picked from commit 708c5cc) (cherry picked from commit dd07bd6)
…tive (apache#23624) Co-authored-by: fanjianye <fanjianye@bigo.sg> (cherry picked from commit 708c5cc) (cherry picked from commit dd07bd6)
Fixes #23622
Motivation
After testing for autoScaledReceiverQueueSizeEnabled config, found that the client memory usage and incomingMessageSize is negative.
This error result in two problem:
By the way, batchReceivePolicy is default used in multiTopicConsumer since pulsar-2.9.4, while autoScaledReceiverQueueSize is a optional config in consumer.
The reason is because when enter ConsumerImpl#notifyPendingReceivedCallback, the message would directly pass to pendingReceive request. Then consumerImpl just decrease the incomingMessageSize, but not increase. So the value become negative
Modifications
fix the error case that only do decrease the size, but not increase.
Verifying this change
Documentation
doc
doc-required
doc-not-needed
doc-complete