Skip to content

Add ability to specify directoryTransferMaxConcurrency in S3TransferManager #6329

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

Conversation

AndreKurait
Copy link

@AndreKurait AndreKurait commented Aug 11, 2025

Motivation and Context

Currently there is a hardcoded value for DEFAULT_DIRECTORY_TRANSFER_MAX_CONCURRENCY in TransferConfigurationOption of 100 added in #5031. When using the S3TransferManager with limited java heap allocation, this can cause OutOfMemory errors due to number of concurrent file downloads.

#6330

Modifications

Updated TransferConfigurationOption to define DirectoryTransferMaxConcurrency and S3TransferManager to use it during upload and download directory with option to specify it in the builder.

Testing

Primary test is the integration style test in Download/Upload DirectoryHelperTest.

While it's difficult to ensure the upper limit is observed without adding arbitrary test time duration to the tests, i've verified locally by modifying the test to use

            .directoryTransferMaxConcurrency(configuredMaxConcurrency - 1)

and observed it timed out after 5 seconds, and with

            .directoryTransferMaxConcurrency(configuredMaxConcurrency + 1)

that it completed very quickly and failed the assertion.

The change makes no behavior change to the default and current behavior

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

…anager creation to limit concurrency on download and upload directory to control memory use

Signed-off-by: Andre Kurait <[email protected]>
@AndreKurait AndreKurait requested a review from a team as a code owner August 11, 2025 16:45
@AndreKurait AndreKurait force-pushed the ConfigurableDirectoryTransferMaxConcurrency branch from 5581092 to be0a85b Compare August 11, 2025 16:48
Signed-off-by: Andre Kurait <[email protected]>
@AndreKurait AndreKurait changed the title [WIP] Add ability to specify directoryTransferMaxConcurrency in S3TransferManager Add ability to specify directoryTransferMaxConcurrency in S3TransferManager Aug 11, 2025
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
61.5% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

AndreKurait added a commit to AndreKurait/opensearch-migrations that referenced this pull request Aug 11, 2025
…ncurrent downloads to 10.

This requires consuming an update in the aws-sdk aws/aws-sdk-java-v2#6329

Signed-off-by: Andre Kurait <[email protected]>
AndreKurait added a commit to AndreKurait/opensearch-migrations that referenced this pull request Aug 11, 2025
…ncurrent downloads to 10.

This requires consuming an update in the aws-sdk aws/aws-sdk-java-v2#6329

Signed-off-by: Andre Kurait <[email protected]>
AndreKurait added a commit to AndreKurait/opensearch-migrations that referenced this pull request Aug 11, 2025
…ncurrent downloads to 10.

This requires consuming an update in the aws-sdk aws/aws-sdk-java-v2#6329

Signed-off-by: Andre Kurait <[email protected]>
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