Skip to content

Avoid redundant same-worker queueing in batch-read completion #4893

Description

@lhotari

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions