lhotari opened a new pull request, #21333: URL: https://github.com/apache/pulsar/pull/21333
### Motivation There's a synchronous method that is called from a thread which shouldn't be blocked. This happens in `ManagedCursorImpl.persistPositionMetaStore` method when the blocking `ledger.mlOwnershipChecker.get()` call is made. `mlOwnershipChecker` was introduced in #5604 and perhaps at that time, the method never blocked. This has changed and for example the flaky test #20157 has shown that this blocking happens in practice and causes deadlocks as reported in #21332. ### Modifications - change the existing `Supplier<Boolean> mlOwnershipChecker` to an asynchronous `Supplier<CompletableFuture<Boolean>> mlOwnershipChecker` - fix a race condition in `ManagedCursorImpl.persistPositionMetaStore` so that the callback for the top level method isn't called before the refreshing has occured. ### 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]
