Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gRPC Context propagation does not work #13959

Closed
cihati opened this issue Dec 17, 2020 · 4 comments
Closed

gRPC Context propagation does not work #13959

cihati opened this issue Dec 17, 2020 · 4 comments
Labels
area/grpc gRPC kind/bug Something isn't working triage/out-of-date This issue/PR is no longer valid or relevant

Comments

@cihati
Copy link

cihati commented Dec 17, 2020

Describe the bug
If I have ServerInterceptor in which I set up some gRPC Context call a different service in a different thread, the Context isn't propagated.

Expected behavior
I expect to able to use Context.current() to have what I set in ServerInterceptor

Actual behavior
The Contexts are different in different threads, and the Context I set in my grpc interceptor is no longer valid.

To Reproduce

  1. Run the reproducer with ./mvnw quarkus:dev
  2. Run grpcurl -v -proto=src/main/proto/helloworld.proto -plaintext -d '{"name": "abc"}' localhost:9000 helloworld.Greeter.SayHello, it works
  3. Now, go to src/main/java/org/acme/MyService.java and uncomment DOES NOT WORK part, try again. It'll fail.

Configuration

# Add your application.properties here, if applicable.
quarkus.grpc.clients.hello.host=localhost
quarkus.log.min-level=DEBUG

Environment (please complete the following information):

  • Output of uname -a or ver: Darwin cihat-layer-mbp.local 19.4.0 Darwin Kernel Version 19.4.0: Wed Mar 4 22:28:40 PST 2020; root:xnu-6153.101.6~15/RELEASE_X86_64 x86_64
  • Output of java -version:
java version "11.0.7" 2020-04-14 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.7+8-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.7+8-LTS, mixed mode)
  • GraalVM version (if different from Java):
  • Quarkus version or git rev:
  • Build tool (ie. output of mvnw --version or gradlew --version):
Maven home: /Users/cihat/.m2/wrapper/dists/apache-maven-3.6.3-bin/1iopthnavndlasol9gbrbg6bf2/apache-maven-3.6.3
Java version: 11.0.7, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk-11.0.7.jdk/Contents/Home
Default locale: en_TR, platform encoding: UTF-8
OS name: "mac os x", version: "10.15.4", arch: "x86_64", family: "mac"

Additional context
Original discussion with @cescoffier and @FroMage at https://quarkusio.zulipchat.com/#narrow/stream/187030-users/topic/Passing.20gRPC.20context.20around/near/220134523

This SO question/answer (non-Quarkus) describes my issue very well: https://stackoverflow.com/questions/47231289/how-to-pass-on-a-traceid-from-grpcs-context-to-another-thread-threadpool

I would like to see a workaround and/or a fix, and would love to see the docs updated as well. Many thanks!

@cihati cihati added the kind/bug Something isn't working label Dec 17, 2020
@ghost ghost added the area/grpc gRPC label Dec 17, 2020
@ghost
Copy link

ghost commented Dec 17, 2020

/cc @cescoffier, @michalszynkiewicz

@michalszynkiewicz
Copy link
Member

michalszynkiewicz commented Jun 10, 2021

@cihati is this still an issue in 2.0.0.CR3?

@cihati
Copy link
Author

cihati commented Jun 12, 2021

To be honest, I don't know. We had quite a few problems with Quarkus at the time and moved away from it.

@cescoffier
Copy link
Member

Just tried quickly and it seems to be fixed. So closing.
If it happens to not be fixed in your case, just re-open the issue and we will have another look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/grpc gRPC kind/bug Something isn't working triage/out-of-date This issue/PR is no longer valid or relevant
Projects
None yet
Development

No branches or pull requests

3 participants