Skip to content

feat(storage): expose highWaterMark option for File stream operations - #9705

Open
thiyaguk09 wants to merge 25 commits into
googleapis:mainfrom
thiyaguk09:feat/file-upload-download-highwatermark
Open

thiyaguk09 wants to merge 25 commits into
googleapis:mainfrom
thiyaguk09:feat/file-upload-download-highwatermark

Conversation

@thiyaguk09

@thiyaguk09 thiyaguk09 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

@google-cloud/storage accepts and propagates the highWaterMark option on File#createReadStream and File#createWriteStream (including simple uploads via ProgressStream and the returned Writable stream).

Default stream buffering when highWaterMark is omitted, internal glue stream buffering, and resumable upload behavior remain unchanged.

@product-auto-label product-auto-label Bot added the api: storage Issues related to the Cloud Storage API. label Oct 23, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for configuring the stream highWaterMark (in bytes) for both readable and writable streams. It adds the highWaterMark option to CreateWriteStreamOptions, CreateReadStreamOptions, and MakeWritableStreamOptions, ensuring it is correctly propagated to underlying streams, including PassThroughShim, Writable, duplexify, and ProgressStream, as well as resumable and simple uploads. Comprehensive unit tests have been added to verify this propagation. There are no review comments, and I have no feedback to provide.

@thiyaguk09
thiyaguk09 marked this pull request as ready for review October 23, 2026 09:54
@thiyaguk09
thiyaguk09 requested review from a team as code owners October 23, 2026 09:54
Comment thread handwritten/storage/src/file.ts Resolved
Comment thread handwritten/storage/test/file.ts Resolved
Comment thread handwritten/storage/src/file.ts Resolved
Comment thread handwritten/storage/src/file.ts Resolved
Comment thread handwritten/storage/src/file.ts Resolved
@thiyaguk09
thiyaguk09 requested a review from Dhriti07 November 11, 2026 09:05

@Dhriti07 Dhriti07 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presubmits are failing for this PR. Please take a look

@thiyaguk09

Copy link
Copy Markdown
Contributor Author

Presubmits are failing for this PR. Please take a look

@Dhriti07 All Node 22/24/26 unit tests (Linux & Windows), lint, breaking-change checks, and storage-system-tests are green — the only failing check is Bun (1.4.2) (exit code 12 from 12 setTimeout timeouts in test/file.ts and test/util.ts after sinon.useFakeTimers runs in sequential --no-parallel mode).

This is pre-existing on main and unrelated to these changes — all open storage PRs, including the Release Please version bump in #9835 (zero code changes) and #9821, are hitting the exact same exit code 12 on Bun (1.4.2).

We can track/fix the Bun fake-timer issue separately so we keep this PR scoped!

@thiyaguk09
thiyaguk09 requested a review from Dhriti07 November 25, 2026 10:45

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the Cloud Storage API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants