feat(storage): Expose Flush() in AsyncWriter#15555
Merged
shubham-up-47 merged 5 commits intogoogleapis:mainfrom Sep 23, 2025
Merged
feat(storage): Expose Flush() in AsyncWriter#15555shubham-up-47 merged 5 commits intogoogleapis:mainfrom
shubham-up-47 merged 5 commits intogoogleapis:mainfrom
Conversation
Contributor
Author
|
/gcbrun |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #15555 +/- ##
========================================
Coverage 93.04% 93.05%
========================================
Files 2408 2408
Lines 220145 220278 +133
========================================
+ Hits 204829 204970 +141
+ Misses 15316 15308 -8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
bajajneha27
reviewed
Sep 19, 2025
Contributor
bajajneha27
left a comment
There was a problem hiding this comment.
Can we also add an integration test for explicit flush?
Contributor
Author
Done. |
bajajneha27
approved these changes
Sep 22, 2025
scotthart
approved these changes
Sep 23, 2025
Member
scotthart
left a comment
There was a problem hiding this comment.
@scotthart reviewed 1 of 3 files at r1, 3 of 3 files at r4, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @bajajneha27)
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.
This change introduces a Flush() method to the AsyncWriter class, providing users with more control over the asynchronous upload process. If multiple Flush() calls are made, they are queued and processed sequentially. Each call returns a future that will be satisfied only when that specific flush operation (and all preceding ones) have been acknowledged by the service.
For unbuffered (StartUnbufferedUpload) and appendable (StartAppendableObjectUpload) uploads, this is implemented using a promise queue to serialize flush operations, ensuring thread safety for concurrent use. For buffered uploads (StartBufferedUpload), the Flush() method currently forwards to Write(). A more complete implementation that forces the buffer to be sent and handles concurrent calls correctly is planned for a follow-up PR.
This change is