Skip to content

Retry support for Java-based S3 multipart client for multipart GET to bytes #6328

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 14 commits into
base: master
Choose a base branch
from

Conversation

davidh44
Copy link
Contributor

@davidh44 davidh44 commented Aug 8, 2025

Motivation and Context

Add retry support for Java-based S3 multipart client when multipart downloading with ByteArrayAsyncResponseTransformer

Modifications

  • Add new class ByteArraySplittingTransformer
    • Similar to SplittingTransformer but each IndividualTransformer creates a new ByteArrayAsyncResponseTransformer, in order to support retries
  • Update ByteArrayAsyncResponseTransformer
    • Override split() to use ByteArraySplittingTransformer

Testing

Add Wiremock tests and refactor existing tests

Types of changes

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

@davidh44 davidh44 changed the title Retry support for Java-based S3 multipart client when downloading with ByteArrayAsyncResponseTransformer Retry support for Java-based S3 multipart client for multipart GET to bytes Aug 11, 2025
@davidh44 davidh44 marked this pull request as ready for review August 11, 2025 20:55
@davidh44 davidh44 requested a review from a team as a code owner August 11, 2025 20:55
@@ -60,11 +63,30 @@ public void onStream(SdkPublisher<ByteBuffer> publisher) {
publisher.subscribe(new BaosSubscriber(cf));
}

public void onStream(SdkPublisher<ByteBuffer> publisher, long maximumBufferSize) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, not sure if we want to add another onStream here, why do we need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Was thinking to use maximumBufferSize for large part sizes, but ByteArrayAsyncResponseTransformer loads everything into memory anyways so its redundant. Will revert this addition

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
78.8% Coverage on New Code (required ≥ 80%)
3.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

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.

2 participants