hrsakai opened a new pull request #6106: Fix available permits may be greater 
than 1 even though queue size is 0.
URL: https://github.com/apache/pulsar/pull/6106
 
 
   ### Motivation
   
   Available permits of ZeroQueueConsuemer must be 1 or less, however 
ZeroQueueConsuemer using listener may be greater than 1.
   
   
   ### Modifications
   
   If listener is processing message, ZeroQueueConsumer doesn't send permit 
when it reconnect to broker.
   
   
   ### Reproduction
   1. ZeroQueueConsuemer using listener consume a topic.
   
   2. Unload that topic( or restart a broker) when listener is processing 
message.
   
   3.  ZeroQueueConsumer sends permit when it reconnect to broker.
   
https://github.com/apache/pulsar/blob/v2.5.0/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ZeroQueueConsumerImpl.java#L133
   
   4. ZeroQueueConsumer also sends permit when finished processing message.
   
https://github.com/apache/pulsar/blob/v2.5.0/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ZeroQueueConsumerImpl.java#L163
   
   5. Available permits become 2.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to