Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces WriterBufferPool, an mmap-backed implementation of the Go Storage SDK's experimental.BufferPool interface designed for gRPC parallel uploads, along with comprehensive unit tests. The reviewer feedback suggests adding a destroyed atomic boolean flag to the pool to prevent use-after-destroy bugs and memory leaks. This flag should be set during Destroy and checked in Get, TryGet, and Put to safely handle late buffer operations.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5273 +/- ##
==========================================
+ Coverage 85.19% 85.24% +0.04%
==========================================
Files 181 182 +1
Lines 19957 20023 +66
==========================================
+ Hits 17003 17068 +65
- Misses 2953 2954 +1
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
1e5fed8 to
5f39751
Compare
|
Hi @kislaykishore, @vadlakondaswetha, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you! |
3 similar comments
|
Hi @kislaykishore, @vadlakondaswetha, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you! |
|
Hi @kislaykishore, @vadlakondaswetha, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you! |
|
Hi @kislaykishore, @vadlakondaswetha, your feedback is needed to move this pull request forward. This automated reminder was triggered because there has been no activity for over 24 hours. Please provide your input when you have a moment. Thank you! |
Description
Implements
WriterBufferPool, a per-writermmap-backed buffer pool implementing the Go Storage SDK'sexperimental.BufferPoolinterface for gRPC parallel uploads.storage.Writergets its ownWriterBufferPoolwith a bounded block cache (capacitymaxBlocksPerFile) while sharing one mount-wide atomic byte budget.Get: Called when the writer holds no blocks to guarantee forward progress. Reuses a cached block if available, or deducts one block from the global budget (even below zero) and allocates viammap.TryGet: Non-blocking call for additional blocks. Reuses a cached block if available, or atomically reserves one block when enough global budget remains and allocates viammap, returningfalsewhen budget is insufficient to throttle concurrency.Put: Unmaps the buffer and returns its bytes to the global budget when over-committed or when the cache is full. Otherwise restores full block length and caches it for reuse.Destroy: Drains the cache channel, unmaps all cached blocks, and returns their bytes to the global budget after the writer closes or aborts.GetandTryGetreject requests that do not match the configured block size, andPutignores buffers with unexpected capacity.Link to the issue in case of a bug fix.
b/548825047
Testing details
Any backward incompatible change? If so, please explain.
No.