io.grpc.SerializingExecutor swallows RuntimeExceptions thrown by gRPC services
- Dominant language
- Java
- Stars
- 12.1k
- Forks
- 4k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 37
Description
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.
Contributor guide
Assessment
This issue has not been assessed yet.