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/09/30 01:31:46 UTC

[GitHub] [pulsar] massakam opened a new pull request #8165: [client] Fix issue where paused consumer receives new message when reconnecting

massakam opened a new pull request #8165:
URL: https://github.com/apache/pulsar/pull/8165


   ### Motivation
   
   Consumers whose `pause()` method is called are expected not to fetch any more new messages from the broker until `resume()` is called. However, when the topic is unloaded or the broker is restarted, the consumer receives new messages.
   
   While the consumer is paused, no flow permits are sent to the broker when the `increaseAvailablePermits()` method is called.
   https://github.com/apache/pulsar/blob/dea574b3c6af7ea8eaa4904d8d6ed1044df00642/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java#L1527-L1538
   
   However, if the `sendFlowPermitsToBroker()` method is called directly, flow permits will be sent even while the consumer is paused. When a reconnection occurs, `sendFlowPermitsToBroker()` is called instead of `increaseAvailablePermits()`.
   https://github.com/apache/pulsar/blob/dea574b3c6af7ea8eaa4904d8d6ed1044df00642/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java#L850-L856
   
   ### Modifications
   
   Fixed consumer classes to always use `increaseAvailablePermits()` instead of `sendFlowPermitsToBroker()`.


----------------------------------------------------------------
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 merged pull request #8165: [client] Fix issue where paused consumer receives new message when reconnecting

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


   


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