Skip to content

Problem with Setting highWaterMark in AWS S3 GetObject Stream #6890

@ujjwol05

Description

@ujjwol05

Checkboxes for prior research

Describe the bug

When using the AWS SDK for JavaScript v3 to stream data from S3 (via GetObjectCommand), I cannot set highWaterMark , I've also set a custom highWaterMark value for stream buffers to see if that works but, the buffer size remains at the 16 KB

Regression Issue

  • Select this option if this issue appears to be a regression.

SDK version number

@aws-sdk/package-name@version, ...

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v20.17.0

Reproduction Steps

const command = new GetObjectCommand(params);
const response = await s3Client.send(command);

const stream = response.Body as NodeJS.ReadableStream;
const customStream = stream.pipe(new Stream.PassThrough({
    highWaterMark: 32 * 1024 
}));

customStream.on("data", (chunk) => {
    console.log(`Chunk size: ${chunk.length}`);
});

Observed Behavior

INFO Chunk size: 16384
INFO Chunk size: 389

Expected Behavior

INFO Chunk size: 30243
INFO Chunk size: 30243

Possible Solution

No response

Additional Information/Context

No response

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.closed-for-stalenessp2This is a standard priority issueresponse-requestedWaiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions