fix: drop head after complete in multipart uploads#1105
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes the post-multipart HeadObject request in the S3 backend upload flow by deriving upload metadata locally (ETag from multipart completion, lastModified set at completion time, and content length tracked via multipart progress). This targets reduced latency (especially tail latency) for multipart uploads.
Changes:
- Drop
HeadObjectcall after multipart upload completion and constructObjectMetadatafrom multipart completion + local progress tracking. - Track uploaded byte count during multipart uploads via
httpUploadProgress.loadedand return it ascontentLength/size. - Update and extend S3 backend tests to assert the new metadata behavior and absence of
HeadObjectrequests.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/storage/backend/s3/adapter.ts | Removes HeadObject after multipart completion; returns metadata using multipart completion output and locally tracked uploaded bytes. |
| src/storage/backend/s3/adapter.test.ts | Updates multipart upload tests to stop expecting HeadObject, and adds coverage for unknown-size multipart uploads with/without progress events. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Coverage Report for CI Build 25805067938Coverage increased (+0.2%) to 75.048%Details
Uncovered Changes
Coverage Regressions2 previously-covered lines in 1 file lost coverage.
Coverage Stats💛 - Coveralls |
f8ed007 to
2ea6388
Compare
2ea6388 to
c465487
Compare
c465487 to
d11e8cc
Compare
d11e8cc to
46160e5
Compare
46160e5 to
af91691
Compare
Signed-off-by: ferhat elmas <elmas.ferhat@gmail.com>
af91691 to
07b0279
Compare
fenos
approved these changes
May 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Bug fix
What is the current behavior?
We do headObject after multipart upload to get object metadata. It adds latency to uploads.
What is the new behavior?
Count bytes locally, get etag from multipart complete, set last modified similar to single upload, then drop head object call.
Additional context
Upload abort handler is cleaned up in success as well.
This will improve tail latency in uploads.