Skip to content

Conversation

zoewangg
Copy link
Contributor

@zoewangg zoewangg commented Aug 13, 2025

…ublisher of ClosableAsyncRequestBody and use it in s3 multipart client

Motivation and Context

  • This PR introduces a new split method, splitClosable in AsyncRequestBody that returns an SdkPublisher of ClosableAsyncRequestBody instead of AsyncRequestBody, enabling proper resource management for split request bodies. The change is primarily implemented to support streaming retry for S3 multipart client for retry Support retries for individual parts of a multipart upload in Java SDK V2 #6198

  • Introduces ClosableAsyncRequestBody interface extending AsyncRequestBody with close capability

  • Updates S3 multipart client implementation to use the new splitClosable method

Testing

Added wiremock tests

Screenshots (if appropriate)

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

@zoewangg zoewangg requested a review from Copilot August 13, 2025 23:12
Copilot

This comment was marked as outdated.

@zoewangg zoewangg requested a review from Copilot August 14, 2025 18:38
Copilot

This comment was marked as outdated.

@zoewangg zoewangg changed the title Introduce a new split method in AsyncRequestBody that returns an SdkP… Stream retry support part 2: Introduce a new split method in AsyncRequestBody that returns an SdkP… Aug 14, 2025
@zoewangg zoewangg requested a review from Copilot August 14, 2025 19:57
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a new splitV2 method in AsyncRequestBody that returns an SdkPublisher of ClosableAsyncRequestBody instead of AsyncRequestBody, enabling proper resource management for split request bodies. This change is designed to support streaming retry for S3 multipart uploads.

  • Adds ClosableAsyncRequestBody interface extending AsyncRequestBody with close capability
  • Updates S3 multipart client implementation to use the new splitV2 method
  • Maintains backward compatibility by deprecating the original split method

Reviewed Changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
ClosableAsyncRequestBody.java New interface extending AsyncRequestBody with close capability
AsyncRequestBody.java Adds splitV2 method and deprecates original split method
SplittingPublisher.java Updates to return ClosableAsyncRequestBody and improve resource management
UploadWithUnknownContentLengthHelper.java Updated to use splitV2 and properly close request bodies
UploadWithKnownContentLengthHelper.java Updated to use splitV2 method
KnownContentLengthAsyncRequestBodySubscriber.java Updated to handle ClosableAsyncRequestBody and close resources
Test files Updated tests to use new interfaces and verify retry behavior

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

…ublisher of ClosableAsyncRequestBody and use it in s3 multipart client
@zoewangg zoewangg marked this pull request as ready for review August 14, 2025 22:54
@zoewangg zoewangg requested a review from a team as a code owner August 14, 2025 22:54
@zoewangg zoewangg force-pushed the zoewang/splitV2 branch 3 times, most recently from 3b244ec to 29f911a Compare August 21, 2025 03:07
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
76.6% Coverage on New Code (required ≥ 80%)
8.9% Duplication on New Code (required ≤ 3%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@zoewangg zoewangg merged commit c82d494 into feature/master/mpu-stream-retry Aug 22, 2025
18 of 29 checks passed
Copy link

This pull request has been closed and the conversation has been locked. Comments on closed PRs are hard for our team to see. If you need more assistance, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants