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/09/04 09:06:16 UTC

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

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

   > Can we let dipatcher() to manage the availablePermits since most cases already covered by various signals in dispatcher()'s select cases. The benefits are 1) centralize one function to manage availablePermits 2) to avoid using Atomic or any synchronizing because avialablePermits can only updated one at a time. To achieve that, can we have failure cases from MessageReceived() to send a signal to a new channel that dispatcher() listens to that will call your new function increasePermitsAndRequestMoreIfNeed()
   
   Hi @zzzming. I agree with you that handle the availablePermits in dispatcher().
   
   > 
   > There might be other cases leaking availablePermits. So in the future, those cases can send a sig to this new increasePermits channel.
   > 
   
   You are right. Chunking also need to increase availablePermits when all the chunks haven't all arrived yet. So this is also a case where need to request more `availablePermits` after return early from `MessageReceived()`.


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