{{ message }}
fix(storage): Implement clean half-close stream teardown for appendable uploads#16112
Merged
Merged
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
9e71403 to
b947f10
Compare
v-pratap
approved these changes
May 26, 2026
This was referenced Jun 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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.