grpc / grpc/grpc-java

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

Aperta
#3,201 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub
usability
Lingua principale
Java
Stelle
12.1k
Fork
4k
Merge medio
2g 17h
PR unite (30g)
37

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.