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

With an UnaryResponse, OnReceiveResponse is never called #429

Open
ecdatadog opened this issue Nov 6, 2023 · 1 comment
Open

With an UnaryResponse, OnReceiveResponse is never called #429

ecdatadog opened this issue Nov 6, 2023 · 1 comment

Comments

@ecdatadog
Copy link

ecdatadog commented Nov 6, 2023

Version used :

  • github.com/fullstorydev/grpcurl 1.8.9
  • google.golang.org/grpc 1.59.0

I am using grpcurl as a library and I discover that the call to OnReceiveResponse of the EventHandler is not called even when there is a success on the grpc call .
When digging in the code, it should be called here : https://github.com/fullstorydev/grpcurl/blob/master/invoke.go#L175-L186
In the google.golang.org/grpc, the function status.FromError has a difference between its documented contract and the actual contract when there is no error :

@jhump
Copy link
Contributor

jhump commented Nov 6, 2023

@ecdatadog, I don't see the issue. The code you highlighted in the grpc status package looks like this:

if err == nil {
    return nil, true
}

So the stat.Code() == codes.OK condition will succeed, and it should print the response message.

Have you stepped through this with a debugger to verify that this is the source of the error? If so, maybe you could elaborate a little more on the actual values you are seeing from the call to status.FromError that are causing the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants