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 2021/01/27 14:43:09 UTC

[GitHub] [pulsar] jkolash opened a new issue #9344: Batch version of acknowledgeAsync will return a completed future before individual messages complete

jkolash opened a new issue #9344:
URL: https://github.com/apache/pulsar/issues/9344


   **Batch version of acknowledgeAsync will return a completed future before individual messages complete**
   ```acknowledgeAsync(Messages<?> messages)``` seems to return a completed future before futures of individual messages will complete. This also affects  the sync version of the call ```acknowledge(Messages<?> messages)```  also calls this method and also doesn't seem to be right.
   
   From ConsumerBase.java
   ```java
       @Override
       public CompletableFuture<Void> acknowledgeAsync(Messages<?> messages) {
           try {
               messages.forEach(this::acknowledgeAsync); //Futures that can be in a pending state
               return CompletableFuture.completedFuture(null); //empty completed Future will be complete even if above futures are incomplete or have an ExecutionException.
           } catch (NullPointerException npe) {
               return FutureUtil.failedFuture(new PulsarClientException.InvalidMessageException(npe.getMessage()));
           }
       }
   ```
   
   **To Reproduce**
   It should be possible to stall the async acknowledgements of the individual messages, or even have them fail and the batched version of acknowledgeAsync will return successfully no matter what.
   
   **Expected behavior**
   The future returned by ```acknowledgeAsync(Messages<?> messages)``` should only complete succesfully after all individual acknowledgements have been completed.
   
   **Workaround**
   It should be possible to write your own batch acknowledgment code in the meantime.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] congbobo184 commented on issue #9344: Batch version of acknowledgeAsync will return a completed future before individual messages complete

Posted by GitBox <gi...@apache.org>.
congbobo184 commented on issue #9344:
URL: https://github.com/apache/pulsar/issues/9344#issuecomment-768779558


   This is a bug for ack receipt, are you interested in fixing it?


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] jiazhai closed issue #9344: Batch version of acknowledgeAsync will return a completed future before individual messages complete

Posted by GitBox <gi...@apache.org>.
jiazhai closed issue #9344:
URL: https://github.com/apache/pulsar/issues/9344


   


----------------------------------------------------------------
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:
users@infra.apache.org