ClientCall.isReady() is true after ClientCall.halfClose()
- Langage dominant
- Java
- Étoiles
- 12.1k
- Forks
- 4k
- Merge moyen
- 2 j 17 h
- PR mergées (30 j)
- 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.
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par les points d’entrée ClientCall.isReady() et halfClose() et suivez la séquence de callbacks de client-streaming présentée dans le rapport. Reproduisez le cas de halfClose() répété, puis examinez les tests existants ou ajoutez un test de régression qui enregistre le comportement de readiness après halfClose() et vérifie le contrat établi.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- grpc, java
- Domaine
- api, backend
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100