poorbarcode commented on code in PR #20649:
URL: https://github.com/apache/pulsar/pull/20649#discussion_r1250492170
##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:
##########
@@ -2451,15 +2451,15 @@ private void trimConsumedLedgersInBackground() {
@Override
public void trimConsumedLedgersInBackground(CompletableFuture<?> promise) {
- executor.execute(() -> internalTrimConsumedLedgers(promise));
+ scheduledExecutor.execute(() -> internalTrimConsumedLedgers(promise));
}
public void trimConsumedLedgersInBackground(boolean isTruncate,
CompletableFuture<?> promise) {
Review Comment:
Both tasks `trim ledgers` and `internalAsyncAddEntry` will try to acquire
the lock `synchronized(ml)`, If the task `trim ledgers` running in the thread
`executor`, it avoids lock contention.
Then if we make the task `trim ledgers` run in another thread, the publish
task will also wait for the lock `synchronized(ml)`. Maybe we need improve this
scenario first
--
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]