grpc / grpc-java

The Java gRPC implementation. HTTP/2 based RPC
https://grpc.io/docs/languages/java/
Apache License 2.0
11.48k stars 3.85k forks source link

Make `TransmitStatusRuntimeExceptionInterceptor.SerializingServerCall`a public class #11689

Closed RichieAHB closed 1 week ago

RichieAHB commented 1 week ago

Is your feature request related to a problem?

Yes

Describe the solution you'd like

Currently we need to map error status codes. It seems like the safest alternative to do this is to use something like TransmitStatusRuntimeExceptionInterceptor.SerializingServerCall otherwise you run the risk of running into concurrency issues in the delegate.

Describe alternatives you've considered

Copying and pasting the code. This will work but it seems unnecessary given custom error mapping seems like a reasonable expectation, but to do it correctly you need to handle serialization.

Additional context

I can see two examples of this already having been copied and pasted in our organization already.

RichieAHB commented 1 week ago

This was not needed for the use case I was thinking of.