Skip to content

Conversation

purnesh42H
Copy link
Contributor

Original PR (#7702)

RELEASE NOTES:

  • mem: use slice capacity instead of length, to determine whether to pool buffers or directly allocate them

…ol buffers or directly allocate them (grpc#7702)

* Address grpc#7631 by correctly pooling large-capacity buffers

As the issue states, `mem.NewBuffer` would not pool buffers with a length below
the pooling threshold but whose capacity is actually larger than the pooling
threshold. This can lead to buffers being leaked.

---------

Co-authored-by: Purnesh Dixit <[email protected]>
Co-authored-by: Easwar Swaminathan <[email protected]>
Copy link

codecov bot commented Oct 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.13%. Comparing base (54841ef) to head (86d7d65).
Report is 1 commits behind head on v1.68.x.

Additional details and impacted files
@@             Coverage Diff             @@
##           v1.68.x    #7792      +/-   ##
===========================================
- Coverage    82.24%   81.13%   -1.12%     
===========================================
  Files          362      362              
  Lines        28116    35671    +7555     
===========================================
+ Hits         23123    28940    +5817     
- Misses        3815     5526    +1711     
- Partials      1178     1205      +27     
Files with missing lines Coverage Δ
mem/buffers.go 88.18% <100.00%> (+4.34%) ⬆️

... and 315 files with indirect coverage changes

@arvindbr8
Copy link
Contributor

vet failed (non-blocking, but worth checking) -

/opt/hostedtoolcache/go/1.23.2/x64/src/runtime/time.go:204:17: cannot range over 3 (untyped int constant): requires go1.22 or later (compile)

Weird that we don't see this in every run

@arvindbr8 arvindbr8 assigned purnesh42H and unassigned easwars and dfawley Oct 29, 2024
@purnesh42H purnesh42H merged commit b79fb61 into grpc:v1.68.x Oct 30, 2024
14 of 15 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 29, 2025
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.

5 participants