BewareMyPower commented on PR #24601: URL: https://github.com/apache/pulsar/pull/24601#issuecomment-3153102095
Yes, `sendAsync` should be the most frequently used async API and it's a critical path. I don't have a chance to check all other async methods, but I have checked `receiveAsync` as well. Unlike `sendAsync`, `receiveAsync` switches to a different thread pool (`PulsarClientImpl#internalExecutorProvider`) from https://github.com/apache/pulsar/pull/10352, so it does not have the similar issue, but it could still affect other processing. Here are my notes when I read the code. ---- Currently a `PulsarClient` will create the following thread pools: | Thread Pool Name | Number of Threads | | :- | :- | | `internalExecutorProvider` | `numIoThreads` | | `externalExecutorProvider` | `numListenerThreads` | | `lookupExecutorProvider` | 1 | `internalExecutorProvider` is used for: - Execute message listener, callbacks of `receiveAsync()` and `batchReceiveAsync()` for consumers - Many callbacks in `TransactionMetaStoreHandler` `externalExecutorProvider` is used for: - Trigger message listener - Trigger consumer event listener ---- As you can see, transaction metadata processing could be affected. But I think it's because executors are used without any careful consideration. Before adding documents, we might need to think if the existing behavior should be documented. -- 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]
