smbecker commented on issue #266:
URL: 
https://github.com/apache/pulsar-dotpulsar/issues/266#issuecomment-2901189907

   So after some additional testing, I found that the issue was that 
`_sendWhenZero` is being decrementing at the start of the `Receive` call. If, 
for some reason, an exception occurs after that happens (i.e. the cancellation 
token being cancelled), this value change is never reverted. This causes 
`CommandFlow` to be called before it actually needs to. In my service, I scale 
down pods based on inactive consumers. To accomplish this, I put a 30s timeout 
on the receive loop. If I haven't received any new messages in the last X 
minutes, I will terminate the pod. This repetitive cancellation on the receive 
loop causes `availablePermits` to increase unnecessarily. 
https://github.com/apache/pulsar-dotpulsar/pull/267 seems to fix that 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.

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

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

Reply via email to