Repository navigation
feat(storage): expose highWaterMark option for File stream operations - #9705
Open
thiyaguk09 wants to merge 3 commits into
Open
thiyaguk09 wants to merge 3 commits into
thiyaguk09 wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
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
marked this pull request as ready for review
October 23, 2026 09:54
This branch has not been deployed
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.
Description
Expose the
highWaterMarkoption forFileupload and download streams.Impact
Users can tune stream buffer sizes to optimize throughput performance.
Changes
highWaterMark?: numberwith TSDoc/JSDoc documentation toCreateReadStreamOptionsandCreateWriteStreamOptionsinsrc/file.ts, as well asMakeWritableStreamOptionsinsrc/nodejs-common/util.ts.highWaterMarkinFile#createReadStreamand pass it to the underlyingPassThroughShimstream returned to callers.highWaterMarkinFile#createWriteStreamand propagate it to the outerWritable,PassThroughShim, andduplexifystreams, as well as to both resumable (resumableUpload.upload) and simple (File#startSimpleUpload_/util.makeWritableStream) upload streams.Testing
test/file.tsverifyingFile#createReadStreamsetsreadableHighWaterMarkwhenhighWaterMarkis provided.test/file.tsverifyingFile#createWriteStreamsetswritableHighWaterMarkand propagateshighWaterMarkto both resumable and simple upload streams.test/file.tsandtest/nodejs-common/util.tsverifyinghighWaterMarkpropagation instartResumableUpload_,startSimpleUpload_, andutil.makeWritableStream.