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/06/22 03:59:04 UTC

[GitHub] [pulsar] Jason918 commented on a diff in pull request #16160: [improve][java-client] Only trigger the batch receive timeout when having pending batch receives requests

Jason918 commented on code in PR #16160:
URL: https://github.com/apache/pulsar/pull/16160#discussion_r903259474


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerBase.java:
##########
@@ -164,12 +164,14 @@ protected ConsumerBase(PulsarClientImpl client, String topic, ConsumerConfigurat
             this.batchReceivePolicy = BatchReceivePolicy.DEFAULT_POLICY;
         }
 
-        if (batchReceivePolicy.getTimeoutMs() > 0) {
+        initReceiverQueueSize();
+    }
+
+    protected void triggerBatchReceiveTimeoutTask() {
+        if (!hasBatchReceiveTimeout() && batchReceivePolicy.getTimeoutMs() > 0) {

Review Comment:
   Both `internalPinnedExecutor` and `client.timer()` threads changes `batchReceiveTimeout`, seems not thread safe.



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