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 2022/10/10 18:39:40 UTC

[GitHub] [pulsar-client-go] zzzming commented on pull request #835: [Issue 833] Fix the availablePermits leak that could cause consumer stuck.

zzzming commented on PR #835:
URL: https://github.com/apache/pulsar-client-go/pull/835#issuecomment-1273683680

   @Gleiphir2769 `availablePermits` is consumer counter to keep track how many messages the broker can send. Upon the initial connection of a consumer, the consumer sets the initial permits to the queue size and sends to the broker; because of that, the available permits reduces to 0. That is in the dispatcher() function.
   For every messages it receives, the available permit is increased by one. This allows the consumer to request more messages once the number of permits over the threshold. This is where you have changed the code in this PR.
   
   `requestPermits` is the number of messages the consumer communicates with the broker that it allows to send. 
   
   These two are very close terminologies. Ultimately, we need one counter to keep track the number of availablePermits. The requestPermits is just an intermediary variable hold the availablePermits value and send to the broker. 
   
   


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

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org