-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Add LocalAddr to peer.Peer (#6577) #6702
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
Conversation
Codecov Report
Additional details and impacted files |
pla := peer.LocalAddr.String() | ||
if _, _, err := net.SplitHostPort(pla); err != nil { | ||
t.Fatalf("Failed to parse local address from peer.") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please assert the actual local addr here? rather than just checking it split host port. Same in other test. (Listener, Conn or hardcoded)
@@ -161,14 +161,18 @@ func checkRoundRobinRPCs(ctx context.Context, client testgrpc.TestServiceClient, | |||
gotAddrCount = make(map[string]int) | |||
// Perform 3 iterations. | |||
var iterations [][]string | |||
var localIterations [][]string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this file. We don't need to add these assertions here.
Closing this because this is part of #6716. |
Resolves #6577 , requesting the ability to log the local address in addition to the remote address for server-side interceptors for debugging.
It isn't obvious to me if we want to also include the local address in the server handler, here . This would require parsing the information form the http request, likely using X-Forward-For .
There may be the necessity for a followup ticket to extend the binarylog package to include the local address in gRPC binary logging.
Hope this helps!