Skip to content

Add expectContinueThresholdInBytes config to S3#6864

Open
alextwoods wants to merge 2 commits intomasterfrom
alexwoo/s3_100cont_threshold
Open

Add expectContinueThresholdInBytes config to S3#6864
alextwoods wants to merge 2 commits intomasterfrom
alexwoo/s3_100cont_threshold

Conversation

@alextwoods
Copy link
Copy Markdown
Contributor

@alextwoods alextwoods commented Apr 15, 2026

Motivation and Context

The Expect: 100-continue header allows a client to check whether the server will accept a request before sending the body. While this saves bandwidth on rejected requests, it adds a full round-trip of latency on every successful request. Benchmark data shows this overhead can increase latency by up to 30% for small uploads (under 1 MB) on public internet.

Currently the SDK unconditionally adds the header to all PutObject and UploadPart requests (when expectContinueEnabled is true). This change introduces a configurable content-length threshold so the header is skipped for small payloads where the cost outweighs the benefit.

This is consistent with other AWS SDKs — JavaScript V3 and Kotlin both use a content-length threshold for this header.

Related to #6774 and #6828

Modifications

  • Added expectContinueThresholdInBytes configuration with default of 1MB.

Testing

new + existing unit tests.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created by the script in .changes/next-release with your changes.
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • I confirm that this pull request can be released under the Apache 2 license

@alextwoods alextwoods requested a review from a team as a code owner April 15, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant