grpc / grpc/grpc-java

io.grpc.SerializingExecutor swallows RuntimeExceptions thrown by gRPC services

Open
#7,725 0 comments 0 reactions 0 assignees View on GitHub
enhancement
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.