Adding trailer metadata in gRPC server error cause the response to fail with UNKNOWN status #31110
-
I don't know if it's a bug or not, I'm not a gRPC expert. When mapping an exception to a gRPC public StatusException toGrpc(final CustomException ex) {
var trailers = new Metadata();
trailers.put(Metadata.Key.of("foo", Metadata.ASCII_STRING_MARSHALLER), "bar");
return Status.fromCode(Code.INTERNAL)
.withDescription(ex.getMessage())
.withCause(ex)
.asException(trailers);
} For example, this ends with status I found this while trying to resolve this issue : https://stackoverflow.com/questions/75412735/quarkus-grpc-exceptionhandlerprovider-does-not-close-response-message-with-the-c (see the end of the question: "Another weird thing is [...]") Repo to reproduce : https://github.com/jdussouillez/quarkus-grpc-exception-handler |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 4 replies
-
/cc @alesj (grpc), @cescoffier (grpc) |
Beta Was this translation helpful? Give feedback.
-
Ok so it seems to work using the Quarkus gRPC client (status is |
Beta Was this translation helpful? Give feedback.
-
This is a known issue ... What's the client-server combination you're using? And this is already fixed in Vert.x upstream ... so it should be fixed once Quarkus gets this new Vert.x version ... |
Beta Was this translation helpful? Give feedback.
-
Yeah, I think new Vert.x gRPC server has this trailers issue ... |
Beta Was this translation helpful? Give feedback.
-
Is this issue already fixed in a new Quarkus release? |
Beta Was this translation helpful? Give feedback.
-
I came across this question and found that the |
Beta Was this translation helpful? Give feedback.
-
Ah, OK ... I see what you mean. The EHProvider impl (in docs case HelloExceptionHandlerProvider) is actually responsible for 2 things Unfortunately it turns out that the current impl couldn't handle all exceptions with (a), My guess is that in your case (b) is called. I guess we need to document this a bit better, explaining / mentioning ^^ ... |
Beta Was this translation helpful? Give feedback.
This is a known issue ...
What's the client-server combination you're using?
I see this with using old Netty gRPC client, and our new Vert.x gRPC server:
And this is already fixed in Vert.x upstream ... so it should be fixed once Quarkus gets this new Vert.x version ...