codelipenghui commented on a change in pull request #9113:
URL: https://github.com/apache/pulsar/pull/9113#discussion_r555474735
##########
File path:
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerBase.java
##########
@@ -847,6 +847,15 @@ protected boolean hasPendingBatchReceive() {
return pendingBatchReceives != null && peekNextBatchReceive() != null;
}
+ protected void resetIncomingMessageSize() {
+ INCOMING_MESSAGES_SIZE_UPDATER.set(this, 0);
+ }
+
+ protected void updateIncomingMessageSize(final Message<?> message) {
+ INCOMING_MESSAGES_SIZE_UPDATER.addAndGet(this,
+ (message.getData() != null) ? message.getData().length : 0);
+ }
Review comment:
Hi @lhotari @BewareMyPower, I will push a fix soon. We should decrease
the incoming queue size when take messages from the queue and increase the
incoming queue size while adding messages to the queue. With #9113, will always
increase the incoming queue size.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]