lhotari opened a new pull request, #25066: URL: https://github.com/apache/pulsar/pull/25066
### Motivation There's currently a gap in the solution for updating a permit so that the race condition where the permit gets released while the updated permit is being acquired isn't handled properly. This bug pattern got triggered by the unintended usage of updated permits while handling permits in ServerCnx's `internalHandleGetTopicsOfNamespace` method and LookupProxyHandler's `internalPerformGetTopicsOfNamespace` method. The problem was that the CompletableFuture chain was broken and the permits were released in a race condition while it was being updated. The impact of this bug is that the memory limits for topic list operations become ineffective over time since more permits are slowly added. ### Modifications - add a solution that prevents a race condition from having an impact on correctness of AsyncSemaphoreImpl behavior - add a failing test case - make the CompletableFuture chains consistent in ServerCnx's `internalHandleGetTopicsOfNamespace` method and LookupProxyHandler's `internalPerformGetTopicsOfNamespace` method ### Documentation <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. --> - [ ] `doc` <!-- Your PR contains doc changes. --> - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later --> - [x] `doc-not-needed` <!-- Your PR changes do not impact docs --> - [ ] `doc-complete` <!-- Docs have been already added --> -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
