grpc / grpc/grpc-java

ClientCall.isReady() is true after ClientCall.halfClose()

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

Description

I have code like this for a client streaming call:

```java
ClientCall call = ...;
ClientCall.Listener listener = new ClientCall.Listener() {
@Override
public void onReady() {
while(call.isReady()) {
if (allDataSent()) {
call.halfClose();
return;
}
sendMessage();
}
}
}
call.start(listener, metadata);
call.request(1);
```

I found `call.halfClose()` to be called more than once (and thus crash). I would have expected `call.isReady()` to be `false` after `call.halfClose()` was called since after half-closing, we certainly can't send any new messages.

Thoughts?

P.S: I am using this API, cause I need flow control and the `CallStreamObserver` is marked experimental.

Contributor guide

Open the contributing guide

Research direction

Start with the ClientCall.isReady() and halfClose() entry points and trace the client-streaming callback sequence shown in the report. Reproduce the repeated halfClose() case, then inspect existing tests or add a regression test that records the post-halfClose readiness behavior and verifies the settled contract.

Written by the indexing model from the issue text.

Assessment

Tech stack
grpc, java
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.