stats: include message header in stats.InPayload.WireLength#3886
Merged
menghanl merged 2 commits intogrpc:masterfrom Sep 25, 2020
Merged
stats: include message header in stats.InPayload.WireLength#3886menghanl merged 2 commits intogrpc:masterfrom
menghanl merged 2 commits intogrpc:masterfrom
Conversation
|
|
Contributor
Author
|
This aims to fix: #1647 |
menghanl
suggested changes
Sep 24, 2020
Contributor
menghanl
left a comment
There was a problem hiding this comment.
Thanks for catching this. Suggested a fix in another place.
rpc_util.go
Outdated
| } | ||
| if payInfo != nil { | ||
| payInfo.wireLength = len(d) | ||
| payInfo.wireLength = len(d) + headerLen |
Contributor
There was a problem hiding this comment.
This field is in sync with payInfo.uncompressedBytes (they both don't include the message header).
Add headerLen when HandleRPC is called?
menghanl
approved these changes
Sep 25, 2020
Contributor
menghanl
left a comment
There was a problem hiding this comment.
Thanks for the fix. LGTM.
vadimi
added a commit
to vadimi/grpc-client-cli
that referenced
this pull request
Oct 9, 2020
grpc fixes it in grpc/grpc-go#3886
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Currently, the
stats.InPayload.WireLengthactually under-reports the true WireSize of each received message by 5 bytes (headerLen), as it does not include the size of the header going over the wire.However,
stats.OutPayload.WireLengthdoes include the size of the 5 byte header inWireLength.This leads to the
InPayload.WireLengthnot being equal to theOutPayload.WireLengthfor the same underlying payload, which further leads to many weird accounting errors.