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

Fix sizing of buffer and don't nil exemplars buffer. #2725

Merged
merged 2 commits into from
Aug 15, 2022

Conversation

pstibrany
Copy link
Member

What this PR does

This PR is a follow-up to #2710. When doing deep copy of request without exemplars, computed buffer size used for copying request was bigger than necessary. At the same time, by nil-ing Exemplars field we thrown away previously allocated slice for exemplars, which could be reused.

Checklist

  • Tests updated
  • [na] Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Signed-off-by: Peter Štibraný <pstibrany@gmail.com>
Signed-off-by: Peter Štibraný <pstibrany@gmail.com>
@pstibrany pstibrany requested a review from replay August 15, 2022 14:21
Copy link
Contributor

@replay replay left a comment

Choose a reason for hiding this comment

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

Nice catch, and sorry that I've missed this in my review of 2710

@pstibrany pstibrany merged commit 70f91b8 into main Aug 15, 2022
@pstibrany pstibrany deleted the fix-exemplar-buffers branch August 15, 2022 15:02
@pstibrany
Copy link
Member Author

Nice catch, and sorry that I've missed this in my review of 2710

I didn't think about it either. Buffer pools are tricky.

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

Successfully merging this pull request may close these issues.

2 participants