Skip to content

Fix TransferManager resume corrupting ranged downloads - #7411

Merged
S-Saranya1 merged 14 commits into
masterfrom
somepal/transfer-manager-resume-range-incorrectly-computed-fix
Oct 7, 2026
Merged

S-Saranya1 merged 14 commits into
masterfrom
somepal/transfer-manager-resume-range-incorrectly-computed-fix

Conversation

@S-Saranya1

@S-Saranya1 S-Saranya1 commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Motivation and Context

S3TransferManager.resumeDownloadFile computes the wrong Range header when resuming a ranged download. The resume path in ResumableRequestConverter#resumedDownloadFileRequest uses bytes=bytesTransferred-contentLength (whole object size), ignoring the original range offset. This produces a silently corrupt file, wrong bytes, wrong size, no error.

Modifications

ResumableRequestConverter: extracted range computation into computeResumedRange and parseRange. When the original request had a range, the resumed range is now bytes=(originalStart+bytesTransferred)-originalEnd. Non-ranged downloads fall through to the existing behavior.

Testing

  • ResumableRequestConverterRangedResumeTest: unit tests verifying correct Range header computation for ranged downloads (multiple offset scenarios) and non-ranged regression.
  • ResumeRangedDownloadWireMockTest: end-to-end WireMock test validating actual file content on disk after ranged and non-ranged resume.
  • CrtTransferManagerPauseAndResumeTest: added ranged resume test for the CRT transfer manager path.
  • All existing tests pass.

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

@S-Saranya1
S-Saranya1 requested a review from a team as a code owner September 30, 2026 19:40
Updated category to 'S3 Transfer Manager' for clarity.
@S-Saranya1
S-Saranya1 requested a review from alextwoods October 1, 2026 20:05
alextwoods
alextwoods previously approved these changes Oct 1, 2026
@alextwoods
alextwoods dismissed their stale review October 2, 2026 16:29

Pending review of new changes.

@S-Saranya1
S-Saranya1 enabled auto-merge October 5, 2026 22:04
@S-Saranya1
S-Saranya1 added this pull request to the merge queue Oct 6, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Oct 7, 2026
@S-Saranya1
S-Saranya1 added this pull request to the merge queue Oct 7, 2026
Merged via the queue into master with commit 8ef8bc4 Oct 7, 2026
17 of 18 checks passed
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

This pull request has been closed and the conversation has been locked. Comments on closed PRs are hard for our team to see. If you need more assistance, please open a new issue that references this one.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Oct 7, 2026
@S-Saranya1
S-Saranya1 deleted the somepal/transfer-manager-resume-range-incorrectly-computed-fix branch October 7, 2026 18:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants