-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Peer details not populated when requests fail #1417
Comments
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What version of gRPC are you using?
1.5.1
What version of Go are you using (
go version
)?1.8.4
What operating system (Linux, Windows, …) and version?
Linux
What did you do?
Add a Peer() call option to a call, then send a request that fails somehow (e.g. bad request).
What did you expect to see?
The peer information is populated
What did you see instead?
The peer information is not populated. It seems to work only if the call succeeds.
We looked at this a bit and it seems like the issue is that Peer() is implemented as a deferred "after" function. invoke() will call sendRequest() and, if an error occurs, it will return. The Peer() code will still run, because it was deferred, but the peer details haven't been filled in yet, so the function will just copy a nil value. The callInfo.peer field is only set at the end of recvResponse(), which never gets invoked when a request fails.
Would it be OK to send a PR that sets the peer in sendRequest() instead? Or maybe in both if e.g. AuthInfo can change between the end of sendRequest and recvResponse.
@MakMukhi @jack0
The text was updated successfully, but these errors were encountered: