Blocking stub blocks indefinitely if client exceeds max outbound message size
- Lingua principale
- Java
- Stelle
- 12.1k
- Fork
- 4k
- Merge medio
- 2g 17h
- PR unite (30g)
- 37
Descrizione
### What version of gRPC-Java are you using?
1.72.0
### What is your environment?
Linux - Ubuntu 22.04.5 LTS
JDK - jdk-corretto_21.0.1.12.1
Repro repository - https://github.com/jackrwoods/grpc-problem-repro
### What did you expect to see?
In the console output, I expect to see "Sending message (Java)" followed by an exception/stacktrace that should interrupt and exit the application
### What did you see instead?
In the console output, I see "Sending message (Java)" and an exception, but the application hangs and does not exit.
### Steps to reproduce the bug
1. Clone the repository https://github.com/jackrwoods/grpc-problem-repro
2. Within the repository, run `./gradlew build`
3. Within the repository, run `./gradlew run`
4. Observe that the application does not exit.
---
When using a blocking stub to frame a grpc message, I am observing that my GRPC call parks the calling thread indefinitely. I always see a logged exception detailing why the request failed, but the GRPC call does not return.
I have set up a repro in this repository: [jackrwoods/grpc-problem-repro](https://github.com/jackrwoods/grpc-problem-repro). I've reproduced this behavior with a "blocking" stub ([jackrwoods/grpc-problem-repro@main/src/main/java/org/example/Main.java](https://github.com/jackrwoods/grpc-problem-repro/blob/main/src/main/java/org/example/Main.java)) and a coroutine stub wrapped with a runBlocking ([jackrwoods/grpc-problem-repro@main/src/main/kotlin/org/example/MainKotlinCoroutineVersion.kt](https://github.com/jackrwoods/grpc-problem-repro/blob/main/src/main/kotlin/org/example/MainKotlinCoroutineVersion.kt?)). In both cases, the application hangs when the maximum GRPC message size is exceeded.
Is this user (me) error, or is there a workaround?
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia dal repository collegato jackrwoods/grpc-problem-repro, esegui ./gradlew build e ./gradlew run e ispeziona Main.java e MainKotlinCoroutineVersion.kt. Riproduci il fallimento dovuto a un messaggio sovradimensionato per entrambi gli stub, quindi traccia il comportamento di terminazione della chiamata bloccante e verifica che l'applicazione termini dopo l'eccezione invece di rimanere bloccata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java, kotlin
- Ambito
- backend-api-design
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100