grpc / grpc/grpc-java

blocking stub v2 server streaming calls sometimes require .read() to initiate request

Open
#12,073 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
12.1k
Forks
4k
Avg merge
2d 17h
Merged PRs (30d)
37

Description

If the channel is in an idle state when `ClientCalls.blockingV2ServerStreamingCall` is invoked, sending the request will be queued up in `DelayedClientTransport`. When the connection is set up, `DelayedClientTransport` will run all the deferred request initiation steps on the call executor: https://github.com/grpc/grpc-java/blob/b88536a17d320065a972858e17e44e1e5c656a0f/core/src/main/java/io/grpc/internal/DelayedClientTransport.java#L306-L312 Unfortunately, the call executor for the blocking v2 stubs is a `ThreadSafeThreadlessExecutor`, which means the headers and request aren't actually sent until the client calls `.read()` on the `BlockingClientCall`.

In contrast, the blocking v1 stub always sent the request as soon as possible.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.