-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 client stream onMessage and onClose executes on different threads #15187
Comments
@Andro999b I just looked that the reproducer, and it seems to work (I bumped the version to 999-SNAPSHOT). I've tried with and without the Did I miss something? |
@cescoffier Pls look at comment that i left in test. Its very trick to reproduce because its relied on threads execution order. |
@cescoffier also rechecked this with |
@cescoffier I have played i bit with my reporoducer and found out that it not reproduce bug) But i think i actually found out a problem: |
Thanks! Fancy a PR? It looks you pinpointed the issue. |
Will try to make fix tomorrow. |
When calling client grpc service method form blocking code(no matter if its blocking or async client). Stream close will be executed on worker thread, but on message event will be executed on event-loop thread. So client stream usually closed before able to reads any message
Expected behavior
OnMessage and OnClose executed in correct order
To Reproduce
https://drive.google.com/file/d/16xdsSuSV4V9pQAJt_HDYoppgqsAGOGoX/view?usp=sharing
Steps to reproduce the behavior:
archive contains single UT that reproduce incorrect behavior.
For more details you will need to debug class
io.grpc.stub.ClientCall.BlockingResponseStream.QueuingListener
to see threadsEnvironment (please complete the following information):
uname -a
orver
: Linux andrii-PC 5.4.0-65-generic Gizmo fixes and enhancements #73-Ubuntu SMP Mon Jan 18 17:25:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linuxjava -version
: openjdk version "11.0.9" 2020-10-20mvnw --version
orgradlew --version
): maven 3.6.3 or gradle 6.5.1The text was updated successfully, but these errors were encountered: