Skip to content

feat(s3): use AWS SDK v2 TransferManager for copy task#684

Merged
fdelbrayelle merged 13 commits intokestra-io:mainfrom
nancysangani:feature/661-aws-s3-transfer-manager
Feb 5, 2026
Merged

feat(s3): use AWS SDK v2 TransferManager for copy task#684
fdelbrayelle merged 13 commits intokestra-io:mainfrom
nancysangani:feature/661-aws-s3-transfer-manager

Conversation

@nancysangani
Copy link
Contributor

Description

Implements AWS SDK for Java v2 TransferManager for S3 copy operations to improve performance through automatic parallelization and multipart-aware copying.

Changes

  • Replaced synchronous S3Client with S3AsyncClient and S3TransferManager
  • Enabled automatic multi-threaded copy operations for better throughput
  • Fixed critical bug: KMS key ID is now actually applied when using AWS_KMS encryption (field was defined but never used)
  • Improved error handling for delete flag with .orElse(false)

Performance Impact

  • Single-threaded → Multi-threaded parallel copy
  • Automatic multipart copy for large files (>5GB)
  • Significant throughput improvement for batch operations

Implementation Details

The TransferManager automatically handles:

  • Parallel uploads for multipart operations
  • Optimal part size calculation
  • Retry logic for failed parts
  • Resource management

Fixes

Closes #661

Copilot AI review requested due to automatic review settings January 29, 2026 16:50
@github-project-automation github-project-automation bot moved this to To review in Pull Requests Jan 29, 2026
Copy link
Contributor

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 migrates the S3 Copy task from using the synchronous S3Client to the AWS SDK v2 TransferManager with S3AsyncClient, enabling automatic parallelization and multipart-aware copying for improved performance. The PR also fixes a critical bug where the KMS key ID field was defined but never actually applied when using AWS_KMS encryption.

Changes:

  • Replaced synchronous S3Client with S3AsyncClient and S3TransferManager for parallel copy operations
  • Fixed critical bug: KMS key ID is now properly applied when using AWS_KMS server-side encryption (lines 122-126)
  • Improved error handling for the delete flag using .orElse(false) instead of .orElseThrow() (line 143)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MilosPaunovic MilosPaunovic requested review from a team and Malaydewangan09 January 30, 2026 06:58
@MilosPaunovic MilosPaunovic added area/plugin Plugin-related issue or feature request kind/external Pull requests raised by community contributors labels Jan 30, 2026
fdelbrayelle and others added 2 commits January 30, 2026 11:58
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
fdelbrayelle and others added 5 commits January 30, 2026 11:58
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@fdelbrayelle
Copy link
Contributor

Hi @nancysangani 👋 Could you provide some screenshots showing how you tested it with AWS and Kestra UI please?
Plus didn't you have to update the unit/integration tests accordingly?

@nancysangani
Copy link
Contributor Author

Hi @fdelbrayelle, sure, I’ll add the screenshots of the tests and update the tests if needed. Will share them ASAP.

@nancysangani
Copy link
Contributor Author

nancysangani commented Feb 5, 2026

Hi @fdelbrayelle, I tested this using a local setup with Kestra + LocalStack (S3) via Docker and verified the behavior through the Kestra UI.

Testing with Kestra UI:

Here is a screen recording showing the flow configuration in the Kestra UI and a successful execution:

Video.Project.-.AWS.mp4
Video.Project.-.AWS.Copy.mp4
Screenshot 2026-02-05 123107

Regarding test updates:

No modifications to the test files were required. The migration from S3Client to S3TransferManager is an internal implementation change that doesn't affect the public API, so all existing tests pass without modification.

@fdelbrayelle fdelbrayelle merged commit e4adf51 into kestra-io:main Feb 5, 2026
1 check passed
@github-project-automation github-project-automation bot moved this from To review to Done in Pull Requests Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/plugin Plugin-related issue or feature request kind/external Pull requests raised by community contributors

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Use AWS SDK for Java v2 TransferManager instead of the old one

3 participants