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 2019/12/09 09:45:08 UTC

[GitHub] [pulsar] massakam opened a new pull request #5823: [pulsar-client] Ensure that the same message ID is not added to UnAckedMessageTracker multiple times

massakam opened a new pull request #5823: [pulsar-client] Ensure that the same message ID is not added to UnAckedMessageTracker multiple times
URL: https://github.com/apache/pulsar/pull/5823
 
 
   ### Motivation
   
   When a message ID is added to `UnAckedMessageTracker`, it is added as an instance of `MessageIdImpl`, not `BatchMessageIdImpl`. Since the batch index information is deleted at this time, the same message ID will be added to `UnAckedMessageTracker` multiple times when consumer receives batched messages.
   https://github.com/apache/pulsar/blob/a8c8a7ee1559bc607b3454fa55134094d8a2c208/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java#L1124-L1134
   
   There is no problem even if the same message ID is added without taking too much time. However, if the interval between these message IDs is long, the message IDs may be added to other elements of `timePartitions`.
   https://github.com/apache/pulsar/blob/09360682953d0cbc154630a470492c11a4f83184/pulsar-client/src/main/java/org/apache/pulsar/client/impl/UnAckedMessageTracker.java#L163-L172
   
   As a result, even if the consumer sends ack, some message IDs remain without being deleted from `timePartitions`, and an unnecessary ack timeout event occurs.
   
   ### Modifications
   
   When adding a message ID to `UnAckedMessageTracker`, check if the same message ID is already included in` timePartitions`, and if it is included, do nothing.

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


With regards,
Apache Git Services