io.grpc.SerializingExecutor swallows RuntimeExceptions thrown by gRPC services
- Vorherrschende Sprache
- Java
- Sterne
- 12.1k
- Forks
- 4k
- Ø Merge
- 2 T. 17 Std.
- Gemergte PRs (30 T.)
- 37
Beschreibung
Users can call ServerBuilder#executor() to arrange for gRPC service callbacks like onNext(), onError() and onCancelHandler to be dispatched on a custom Executor. However, when one of those callbacks throws a RuntimeException (due to bug / programming error in the service) that Executor and/or its Thread's UncaughtExceptionHandler never sees it. Instead, io.grpc.SerializingExecutor catches the RuntimeException, logs it and just keeps going.
This might be enough in the datacenter where server logs are typically retained for later debugging, but for mobile "on-device" gRPC servers, the java.util.logging output isn't typically seen by anyone. In that environment, it's more common to handle unexpected Exceptions programmatically and gRPC should somehow make this possible.
Beitragsleitfaden
Rechercherichtung
Beginne mit io.grpc.SerializingExecutor und dem im Issue beschriebenen Pfad ServerBuilder#executor(). Verfolge, wie RuntimeExceptions aus Service-Callbacks wie onNext(), onError() und onCancelHandler behandelt werden, und bestimme anschließend ein explizites Verhalten, das es mobilen Servern ermöglicht, sie programmgesteuert zu behandeln, statt sie nur zu protokollieren. Als erledigt gilt die Aufgabe, wenn das gewählte Verhalten zur Ausnahmebehandlung definiert und verifiziert ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java
- Bereich
- backend-api-design
- Issue-Typ
- Bug
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100