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 2021/06/05 07:24:54 UTC

[GitHub] [pulsar] lhotari commented on pull request #10831: [Broker] Fix possible data race in getFirstAvailableConsumerPermits

lhotari commented on pull request #10831:
URL: https://github.com/apache/pulsar/pull/10831#issuecomment-855198391


   > @lhotari - in order to call `get` on the atomic wrapper just once, what if we added a new method that returns an `Optional<Integer>` that is a combination of the `isConsumerAvailable` and the `getAvailablePermits` methods? It would introduce additional overhead for the new objects, so perhaps it's an unnecessary change. Do you have a preference?
   
   In this part of code I believe that there's a goal of zero allocations since this is part of a hot code path. Therefore, omitting the usage of Optional is also desired.


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