Client does not complete send operation until async block of code is reached
- Dominant language
- TypeScript
- Stars
- 4.8k
- Forks
- 716
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 10
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.
Contributor guide
Assessment
This issue has not been assessed yet.