lhotari opened a new pull request, #19388:
URL: https://github.com/apache/pulsar/pull/19388
### Motivation
It is not recommended to run possible blocking operations on Zookeeper event
thread, Metadata Store notification thread or Netty IO threads.
Execution could happen unintentionally on these threads since
`CompletableFuture` callbacks (`thenCompose`, `thenAccept`, `thenRun`,
`whenComplete`, ...) run on the thread that completes the `CompletableFuture`.
In PersistentTopic, there are a few locations where there are potential
issues. It's better to run the callbacks on another thread pool when there's a
heavy operation or any operation that uses synchronization or locks.
### Modifications
- replace `thenAccept` -> `thenAcceptAsync` and `thenRun` -> `thenRunAsync`
in a few call chains
- use `brokerService.getTopicOrderedExecutor().chooseThread(topic)` as the
executor.
### 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]