fix(storage): Implement clean half-close stream teardown for appendable uploads#16112
fix(storage): Implement clean half-close stream teardown for appendable uploads#16112kalragauri wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a Close method to the AsyncWriterConnection interface and its implementation, allowing for a clean flush of pending data followed by a stream half-close. The changes update the PartialUpload state machine to support a new kFlushAndClose action and include comprehensive unit tests. Feedback indicates that the Close() implementation in AsyncWriterConnectionImpl might return a satisfied future before the underlying gRPC Finish() call completes, which could lead to missed errors or incomplete teardowns.
64b44c1 to
9e71403
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #16112 +/- ##
==========================================
- Coverage 92.71% 92.71% -0.01%
==========================================
Files 2353 2353
Lines 218986 219067 +81
==========================================
+ Hits 203031 203100 +69
- Misses 15955 15967 +12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
9e71403 to
b947f10
Compare
Currently, closing an active write stream triggers a standard Flush() and cancels the stream. By using a clean half-close, the client abandons the write side cleanly, allowing GCS to persist all outstanding data.
This first PR introduces the core API interface, and the base stream close implementation. Subclass decorators (such as the Buffered, Resumed, and Tracing connections) are configured with a default fallback to standard Flush() to keep this PR small and safe. Follow-up PRs will customize the implementation under these sub-classes.