-
Notifications
You must be signed in to change notification settings - Fork 433
feat(storage): Expose Flush() in AsyncWriter #15555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(storage): Expose Flush() in AsyncWriter #15555
Conversation
|
/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
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also add an integration test for explicit flush?
Done. |
scotthart
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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 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