Skip to content

Feat S3 Transfer Manager v2 DownloadDirectory #3163

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: main
Choose a base branch
from

Conversation

wty-Bryant
Copy link
Contributor

Implement v2 s3 transfer manager's DownloadDirectory api bound to single union client which mimics normal service client's initialization and api call. User could now download a bucket's objects to local directory with customized filtering and file naming in a single operation call.

Test: This PR passed unit tests for DownloadDirectory which covers use cases with different config and objects naming to confirm this key-prefix downloader could find valid objects, generate correct file path and pass download requests to S3 concurrently. It also passed integration test which uploads objects with different sizes to S3 via S3 client, then downloads objects back using new directory downloader and checks their content consistency

@wty-Bryant wty-Bryant requested a review from a team as a code owner August 8, 2025 20:58

// A callback function to allow customers to update individual
// GetObjectInput that the S3 Transfer Manager generates
Callback GetRequestCallback
Copy link
Contributor

Choose a reason for hiding this comment

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

You seem to be missing a few inputs from the SEP

  • recursive
  • failurePolicy

Copy link
Contributor

Choose a reason for hiding this comment

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

Talked offline, design for these seems to be somewhat in-flux so we can defer for now.

return i.downloadDirectory(ctx)
}

type directoryDownloader struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

Progress listener support?

if !ok {
break
}
if d.getErr() != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

You should likely also be checking for context cancellation here (after the channel read).

break
}

err = os.MkdirAll(filepath.Dir(data.path), os.ModePerm)
Copy link
Contributor

Choose a reason for hiding this comment

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

os.ModePerm is 0777, i.e. anyone on the system can read/write/execute/cd into it. I doubt that's what we want to set here. I don't see a set of default permissions mentioned in the SEP, I would seek clarification from the authors.

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