Skip to content

Client does not complete send operation until async block of code is reached #2996

@tomas-kvaraciejus-bentley

Description

We've noticed a performance issue with @grpc-js in our performance logging workflow. It's set up so that a client periodically sends small messages to a server every 500ms. Unfortunately, the server does not receive any of these until the client process reaches an async block of code, at which point all previously queued messages are sent in a massive burst. The messages stay in a sort of queue for however long it takes to reach the next await block, which in our scenario takes up to a minute.
After some debugging, we've found that http2Stream!.write(message, cb) is indeed successfully called immediately after every send request, but that the operation is not performed and the cb is not invoked until the next block of async code.
This is not a question of performance - 500ms is more than enough time to send and receive a small message between local processes.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions