You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/09/22 12:30:06 UTC

[GitHub] [pulsar] congbobo184 commented on a diff in pull request #17318: [fix][client] Messages with inconsistent consumer epochs are not filtered when using batch receive and trigger timeout.

congbobo184 commented on code in PR #17318:
URL: https://github.com/apache/pulsar/pull/17318#discussion_r977591244


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerBase.java:
##########
@@ -839,12 +840,16 @@ protected boolean canEnqueueMessage(Message<T> message) {
 
     protected boolean enqueueMessageAndCheckBatchReceive(Message<T> message) {
         int messageSize = message.size();
-        if (canEnqueueMessage(message) && incomingMessages.offer(message)) {
-            // After we have enqueued the messages on `incomingMessages` queue, we cannot touch the message instance
-            // anymore, since for pooled messages, this instance was possibly already been released and recycled.
-            INCOMING_MESSAGES_SIZE_UPDATER.addAndGet(this, messageSize);
-            getMemoryLimitController().ifPresent(limiter -> limiter.forceReserveMemory(messageSize));
-            updateAutoScaleReceiverQueueHint();
+        // synchronize redeliverUnacknowledgedMessages()
+        synchronized (incomingQueueLock) {

Review Comment:
   if use share sub, may we don't need this lock



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org