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

binarylog: Account for key in metadata truncation #5851

Merged
merged 2 commits into from Dec 9, 2022

Conversation

zasweq
Copy link
Contributor

@zasweq zasweq commented Dec 9, 2022

This PR adds accounting for the key bytes in metadata truncation, whereas previously it was not accounting for the key, just the value. This makes it consistent with other languages accounting, which is the length of key + value.

The added test fails on master (logs the metadata) but works (doesn't log the metadata) with my fix.

RELEASE NOTES: N/A

@zasweq zasweq requested a review from dfawley December 9, 2022 01:32
@zasweq zasweq added this to the 1.52 Release milestone Dec 9, 2022
Copy link
Member

@dfawley dfawley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor testing nit. Please also fix the PR title:

  • binarylog instead of the abbreviated binlog
  • not past tense

ClientRPCEvents: []clientRPCEvents{
{
Methods: []string{"*"},
MaxMetadataBytes: 6,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be slightly nicer as:

const mdValue = "value"
...
MaxMetadataBytes: len(mdValue) + 1,
...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, nice suggestion. Switched.

@zasweq zasweq changed the title binlog: Accounted for key in metadata truncation binarylog: Account for key in metadata truncation Dec 9, 2022
@dfawley dfawley assigned zasweq and unassigned dfawley Dec 9, 2022
@zasweq zasweq merged commit 3e27f89 into grpc:master Dec 9, 2022
1 check passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants