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 2020/12/22 12:39:17 UTC

[GitHub] [pulsar] saosir opened a new issue #9028: [C++] PartitionedConsumerImpl send redeliverMessages repeatedly

saosir opened a new issue #9028:
URL: https://github.com/apache/pulsar/issues/9028


   **Describe the bug**
   Both `PartitionedConsumerImpl` and `ConsumerImpl` have member variable `unAckedMessageTrackerPtr_` (class UnAckedMessageTrackerEnabled), and `PartitionedConsumerImpl` is composed of `ConsumerImpl`. If the acknowledgement times out, they will send redeliverMessages repeatedly, `MultiTopicsConsumerImpl` has same problem.
   
   see #8606 
   
   **To Reproduce**
   1. subscribe a partitioned topic and set UnAckedMessagesTimeoutMs
   
   ```cpp
   Consumer consumer;
   ConsumerConfiguration consumerConf;
   consumerConf.setUnAckedMessagesTimeoutMs(11000);  // must >= 10000
   consumerConf.setTickDurationInMs(11000);
   Result result = client.subscribe("my-topic", "consumer-1", consumerConf, consumer);
   ```
   
   2. recevie a msg from partitioned topic and not do acknowledge
   ```cpp
   Message msg;
   consumer.recevie(msg)
   sleep(20000);
   ```
   3. sleep 20000ms to trigger `redeliverMessages` repeatedly 
   ```cpp
   sleep(20000);
   ```
   
   **Expected behavior**
   Only one `redeliverUnacknowledgedMessages` should be sent in `PartitionedConsumerImpl`
   


----------------------------------------------------------------
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] saosir commented on issue #9028: [C++] PartitionedConsumerImpl send redeliverMessages repeatedly

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


   Is the member variable `unAckedMessageTrackerPtr_` in `PartitionedConsumerImpl` and `MultiTopicsConsumerImpl` redundant?


----------------------------------------------------------------
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] BewareMyPower commented on issue #9028: [C++] PartitionedConsumerImpl send redeliverMessages repeatedly

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


   @codelipenghui I agree with @saosir , the point is that should Java client's implementation also have the problem? See
   
   https://github.com/apache/pulsar/blob/c17253b3b43c36250ba106dd7a17f35f64f546e5/pulsar-client/src/main/java/org/apache/pulsar/client/impl/MultiTopicsConsumerImpl.java#L101
   
   https://github.com/apache/pulsar/blob/c17253b3b43c36250ba106dd7a17f35f64f546e5/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java#L134
   
   Both `ConsumerImpl` and `MultiTopicsConsumerImpl` hold an `UnAckedMessageTracker`, when the tracker's timeout exceeds, it will trigger the redelivery.
   
   IMO, the `unAckedMessageTracker` of `MultiTopicsConsumerImpl` is redundant. And this feature of C++ client is ported from Java client. So I think if C++ client needs changes, Java client also needs changes.


----------------------------------------------------------------
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] codelipenghui commented on issue #9028: [C++] PartitionedConsumerImpl send redeliverMessages repeatedly

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


   @BewareMyPower Please help take a look at this issue.


----------------------------------------------------------------
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] saosir commented on issue #9028: [C++] PartitionedConsumerImpl send redeliverMessages repeatedly

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


   @BewareMyPower ConsumerImpl will check if there is a parent when track message in Java client's implementation
   https://github.com/apache/pulsar/blob/c17253b3b43c36250ba106dd7a17f35f64f546e5/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java#L1541-L1547


----------------------------------------------------------------
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] saosir commented on issue #9028: [C++] PartitionedConsumerImpl send redeliverMessages repeatedly

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


   OK, I will submit a PR later


----------------------------------------------------------------
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] BewareMyPower commented on issue #9028: [C++] PartitionedConsumerImpl send redeliverMessages repeatedly

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


   Got it. It looks like we should also check if there's a parent in C++ client.


----------------------------------------------------------------
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] BewareMyPower commented on issue #9028: [C++] PartitionedConsumerImpl send redeliverMessages repeatedly

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


   Since the reason is clear, could you contribute a PR to fix 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] sijie closed issue #9028: [C++] PartitionedConsumerImpl send redeliverMessages repeatedly

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


   


----------------------------------------------------------------
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] saosir commented on issue #9028: [C++] PartitionedConsumerImpl send redeliverMessages repeatedly

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


   In addition, `UnAckedMessageTrackerEnable` did not clean up the `batchIndex` of `MessageId` when tracking the message. That will cause only the last message in the batch to be cleared from UnAckedMessageTrackerEnabled when `doAcknowledgeIndividual` and send redeliverMessages repeatedly 


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