Parallelize initiate and complete directory multipart upload#670
Merged
Conversation
Codecov Report❌ Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
GianlucaFicarelli
force-pushed
the
improve_directory_upload
branch
5 times, most recently
from
July 17, 2026 14:33
722f129 to
3b5e157
Compare
GianlucaFicarelli
marked this pull request as ready for review
July 17, 2026 14:43
GianlucaFicarelli
force-pushed
the
improve_directory_upload
branch
from
July 20, 2026 07:51
3b5e157 to
73c3dcd
Compare
eleftherioszisis
approved these changes
Jul 20, 2026
GianlucaFicarelli
enabled auto-merge (squash)
July 20, 2026 09:36
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.
Parallelize multipart upload directory initiate and complete.
Implement #669 with threads.
Speeds up directory uploads by running S3
CreateMultipartUploadandCompleteMultipartUploadcalls concurrently across files, instead ofsequentially.
Changes
app/service/asset_helpers.py(new file)asset.py:initiate_multipart_upload,complete_asset_s3,complete_empty_asset_s3,generate_upload_presigned_urls,build_asset_read_with_upload_metaapp/service/asset.pyinitiation is now parallelized via
ThreadPoolExecutorvia
ThreadPoolExecutorentity_asset_empty_upload_initiateandentity_asset_empty_upload_completefunctions (logic absorbed into helpers)create_entity_asset_unverifiednow returnsAsset(ORM object) instead ofAssetRead, avoiding redundant serialization in callersapp/utils/s3.pyget_s3_clientnow returns a thread-local client (one per storage type perthread) using
boto3.session.Session(), avoiding concurrent access to theshared default session
app/utils/virtual_lab.pyresolve_virtual_lab_idhelper to deduplicate repeatedvirtual-lab-id resolution logic across asset service functions
app/config.pyS3_DIRECTORY_UPLOAD_MAX_WORKERSsetting (default: 32)