Skip to content

Make exceptions visible to the developer and potentially terminate the GRCPServer #2244

Open
@Jerry-Carter

Description

@Jerry-Carter

Improve the handling of exceptions in GRPCServer such that fatal errors terminate the server and are reported to the developer.

Is your feature request related to a problem? Please describe it.

In my application, when GRPCServer.serve() is executed, an error occurs while setting up TLS in the transport layer causing an exception to be thrown. This exception is caught and rethrown by GRPCServer.serve() but it does not ever appear to be printed or otherwise made available to the developer; instead the exception appears to be silently swallowed. The GRPC server appears to be running fine when, in fact, it has failed.

Describe the solution you'd like

Fatal errors should cause the server to terminate, gracefully when possible. The developer should be informed about the exception to facilitate debugging and, in production, application monitoring. Silent failures are very bad.

Describe alternatives you've considered

If necessary, a Logger could be passed to GRPCServer.serve, but I presume there are good reasons for not doing so or it would already be the case.

Additional context

In my application, the TransportServices flavor of HTTP2ServerTransport is being used, but the error handling appears to be more general and within GRPCCore. Additionally, I'm using the ServiceLifetime run() code from grpc-swift-extras.

And, finally, this is my first grpc-swift 2.x server so it is possible that an RTFM answer is in order. Should that be the case, I apologize in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions