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

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.