Skip to content

Support async send requests #1586

@zyguan

Description

@zyguan

Currently, the KV client only provides synchronous API for sending requests. If a query needs to issue multiple requests concurrently, it inevitably has to create a new goroutine for each concurrent procedure. A typical scenario is batch-get, which groups keys into batches based on regions. When the number of batches exceeds one, a worker goroutine is created for each batch to send KV requests.

We aim to reduce the number of goroutines while still allowing requests to be issued concurrently as before. To achieve this, we need to introduce async API. In fact, the internal batch client processes requests and responses asynchronously through send loop and recv loop. It's not difficult to implement an async method for RPCClient, but rewriting upper layer in an async way require a significant amount of work. This issue tries to describe the brief work plan, it's also used to track related PRs.

Here is the related task breakdown

Bugfixes:

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects-8.5This bug affects the 8.5.x(LTS) versions.enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions