LedgerHandle.batchReadUnconfirmedAsync() uses whenCompleteAsync(..., executor) to complete the returned future. This requeues the continuation even when the batch-read response has already completed on the ledger handle's worker thread.
#4881 aligns callback execution with the handle's ordering key, and #4883 avoids redundant queueing when issuing reads from that worker. The batch-read completion continuation still takes an additional trip through the same executor queue, where it can wait behind unrelated pending work for the ledger.
Consider running the continuation inline when already on the handle's worker, using executeOrRun, while preserving worker affinity for completions from other threads. The change should cover success, unsupported-batch fallback and failure paths, with attention to reentrant completion behavior.
LedgerHandle.batchReadUnconfirmedAsync()useswhenCompleteAsync(..., executor)to complete the returned future. This requeues the continuation even when the batch-read response has already completed on the ledger handle's worker thread.#4881 aligns callback execution with the handle's ordering key, and #4883 avoids redundant queueing when issuing reads from that worker. The batch-read completion continuation still takes an additional trip through the same executor queue, where it can wait behind unrelated pending work for the ledger.
Consider running the continuation inline when already on the handle's worker, using
executeOrRun, while preserving worker affinity for completions from other threads. The change should cover success, unsupported-batch fallback and failure paths, with attention to reentrant completion behavior.