Skip to content

Stream retry support part 2: Introduce a new split method in AsyncRequestBody that returns an SdkP… #6346

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

Open
wants to merge 2 commits into
base: feature/master/mpu-stream-retry
Choose a base branch
from

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 splitV2 method 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 splitV2 method
    Maintains backward compatibility by deprecating the original split 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
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
66.5% Coverage on New Code (required ≥ 80%)
12.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

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