quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
14.11k stars 2.76k forks source link

GRPC StatusRuntimeException metadata on client side is empty #45248

Closed ashalak-kaseya closed 1 week ago

ashalak-kaseya commented 1 month ago

Describe the bug

During GRPC communication on server's side I throw StatusRuntimeException with some custom trailers, meaning metadata with some special keys with values.

After triggering the request I see that the client's side "onClose" trailers are empty, but headers contain my data instead. So without custom interceptor for GRPC client below I cannot get my data from StatusRuntimeException's trailers (using exc.getTrailers()): Image

Expected behavior

On client's side trailers inside StatusRuntimeException have to contain trailers are added on server side.

Actual behavior

On client's side trailers inside StatusRuntimeException are empty, but instead that headers contain trailers are added on server side.

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

21

Quarkus version or git rev

3.12.3

Build tool (ie. output of mvnw --version or gradlew --version)

gradle 8.11

Additional information

No response

quarkus-bot[bot] commented 1 month ago

/cc @alesj (grpc), @cescoffier (grpc)

gsmet commented 1 month ago

First, I would recommend trying with a more recent version as 3.12 is quite old and unmaintained. 3.15 LTS would be a safer choice as it will be maintained for longer.

Now I'm not really sure it will fix your issue and from what I can see it's the behavior of the gRPC lib itself that is problematic to you.

Ideally you should provide a small Maven reproducer so that someone can have a look but if it's gRPC itself behaving this way, not sure we will be able to do anything in Quarkus.

It might be useful to check if you have the same behavior with the vanilla gRPC lib.

cescoffier commented 3 weeks ago

@ashalak-kaseya Can you please provide a standalone reproducer?

geoand commented 1 week ago

Closing for lack of a reproducer