-
Notifications
You must be signed in to change notification settings - Fork 937
Faster uploader #1256
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
Merged
Merged
Faster uploader #1256
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
761e5d3
upload multiple chunks at a time
oscartbeaumont 942b4e4
capture OS and Arch in PostHog events
oscartbeaumont e0a8cf4
wip: upload multiple chunks at once w/ presigning
oscartbeaumont 683e25b
wip
oscartbeaumont d6db418
new buffered stream uploader
oscartbeaumont 2653376
bump chunk size
oscartbeaumont 659e253
reuse part 1 presigned URL
oscartbeaumont 451545a
don't reuse first presigned url if using md5 hashes
Brendonovich 9c900bb
use min and max chunk size
Brendonovich 83f3195
remove unnecessary check
Brendonovich File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
LGTM!
The
Send + 'staticbounds on the input stream and'staticreturn type are necessary for the concurrent, buffered upload architecture. The stream must beSendto be processed across threads, and'staticto live beyond the function scope.Verify that all call sites of
multipart_uploadersatisfy these new bounds:🏁 Script executed:
Length of output: 2519
Length of output: 962
🏁 Script executed:
Length of output: 836
🏁 Script executed:
Length of output: 137
🏁 Script executed:
Length of output: 641
🏁 Script executed:
Length of output: 1185
Length of output: 2135
🏁 Script executed:
Length of output: 1844
🏁 Script executed:
Length of output: 131
🏁 Script executed:
Length of output: 149
Address bounds incompatibility between
multipart_uploaderand its call sitesThe new
Send + 'staticbounds on the input stream parameter are incompatible with the actual streams being passed. The functionfrom_pending_file_to_chunks(line 483) captures aReceiver<()>which is notSend, making the returned stream non-Send. Similarly, theprogress()wrapper (line 876) does not guaranteeSend + 'staticbounds on its output.Both call sites (lines 80 and 404) will fail to compile because they pass non-
Sendstreams tomultipart_uploader, violating the new bounds.Fix either:
from_pending_file_to_chunksto returnimpl Stream<Item = io::Result<Chunk>> + Send + 'static(e.g., by removing the capturedReceiver<()>or refactoring to avoid capturing it in the stream)progress()to preserve/addSend + 'staticboundsmultipart_uploaderif the concurrent architecture doesn't actually requireSend + 'static🤖 Prompt for AI Agents