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/02/18 11:06:43 UTC

[GitHub] [pulsar] Technoboy- opened a new pull request #14377: Fix adding message to list potential issue

Technoboy- opened a new pull request #14377:
URL: https://github.com/apache/pulsar/pull/14377


   ### Motivation
   
   There may exist potential issue when adding MessageIdData into `data`
   
   ### Documentation
     
   - [x] `no-need-doc` 
     
   
   
   


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



[GitHub] [pulsar] Shawyeok commented on a change in pull request #14377: Fix adding message to list potential issue

Posted by GitBox <gi...@apache.org>.
Shawyeok commented on a change in pull request #14377:
URL: https://github.com/apache/pulsar/pull/14377#discussion_r826547320



##########
File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java
##########
@@ -1907,18 +1907,17 @@ protected void completeOpBatchReceive(OpBatchReceive<T> op) {
             return CompletableFuture.completedFuture(Collections.emptyList());
         }
         List<MessageIdData> data = new ArrayList<>(messageIds.size());

Review comment:
       There are seem another potential race condition, use `ArrayList` in possible `multithread` scenario is unsafe.

##########
File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java
##########
@@ -1907,18 +1907,17 @@ protected void completeOpBatchReceive(OpBatchReceive<T> op) {
             return CompletableFuture.completedFuture(Collections.emptyList());
         }
         List<MessageIdData> data = new ArrayList<>(messageIds.size());

Review comment:
       I've create #14687 to continue this discussion.




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



[GitHub] [pulsar] merlimat merged pull request #14377: Fix adding message to list potential issue

Posted by GitBox <gi...@apache.org>.
merlimat merged pull request #14377:
URL: https://github.com/apache/pulsar/pull/14377


   


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



[GitHub] [pulsar] Technoboy- commented on a change in pull request #14377: Fix adding message to list potential issue

Posted by GitBox <gi...@apache.org>.
Technoboy- commented on a change in pull request #14377:
URL: https://github.com/apache/pulsar/pull/14377#discussion_r826646208



##########
File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java
##########
@@ -1907,18 +1907,17 @@ protected void completeOpBatchReceive(OpBatchReceive<T> op) {
             return CompletableFuture.completedFuture(Collections.emptyList());
         }
         List<MessageIdData> data = new ArrayList<>(messageIds.size());

Review comment:
       Ah, yes.




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