Skip to content
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

Fix Length::UpTo usage in FsBuilder so it does not exceed available file length #3797

Merged
merged 2 commits into from
Aug 21, 2024

Conversation

ysaito1001
Copy link
Contributor

@ysaito1001 ysaito1001 commented Aug 20, 2024

Motivation and Context

awslabs/aws-sdk-rust#821

Description

This PR addresses an issue with the Length::UpTo usage in FsBuilder. Previously, if a value specified for UpTo exceeded the remaining file length, FsBuilder would incorrectly accept the value. This discrepancy led to failures in subsequent request dispatches, as the actual body size did not match the advertised Content-Length, as explained here (thank you @pablosichert for a self-contained reproducer and problem analysis!).

Testing

  • Added a unit test for FsBuilder verifying the Length::UpTo usage
  • Ran successfully a customer provided reproducer with the code changes in this PR (with an added a call to complete_multipart_upload at the end, it also succeeded in uploading the object):
upload_id: cTDSngbubD25cOoFCNgjpG55o0hAMQNjO16dNFyNTKjg9PEtkcrKG5rTGzBns7CXoO8T.Qm9GpNj6jgwJTKcXDpsca95wSMWMDfPF0DBhmbk3OAGHuuGM1E70spk2suW
File created
part_number: 1, e_tag: "5648ddf58c7c90a788d7f16717a61b08"
part_number: 2, e_tag: "a6bdad6d65d18d842ef1d57ca4673bc3"
part_number: 3, e_tag: "f518f6b19b255ec49b61d511288554fc"
part_number: 4, e_tag: "1496524801eb1d0a7cfbe608eb037d9c"
part_number: 5, e_tag: "21340de04927ce1bed58ad0375c03e01"

Checklist

  • For changes to the smithy-rs codegen or runtime crates, I have created a changelog entry Markdown file in the .changelog directory, specifying "client," "server," or both in the applies_to key.
  • For changes to the AWS SDK, generated SDK code, or SDK runtime crates, I have created a changelog entry Markdown file in the .changelog directory, specifying "aws-sdk-rust" in the applies_to key.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

@ysaito1001 ysaito1001 marked this pull request as ready for review August 20, 2024 20:13
@ysaito1001 ysaito1001 requested review from a team as code owners August 20, 2024 20:13
Copy link
Contributor

@Velfi Velfi left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this Yuki

@ysaito1001 ysaito1001 added this pull request to the merge queue Aug 21, 2024
Merged via the queue into main with commit 84111a0 Aug 21, 2024
44 checks passed
@ysaito1001 ysaito1001 deleted the ysaito/fix-length-up-to-variant branch August 21, 2024 15:40
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.

3 participants