Skip to content

remote_execution: synchronize concurrent upload of identical artifacts #945

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

Conversation

thoughtpolice
Copy link
Contributor

Currently, upload requests are handled in parallel without knowledge of other ongoing requests. If multiple actions depend on the same set of large locally available artifacts, then they will all be uploaded at the same time. This is particularly poor behavior for large files.

Just store in-flight requests in a dashmap, and wait if an upload is already extant.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 7, 2025
@facebook-github-bot
Copy link
Contributor

@facebook-github-bot has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. (Because this pull request was imported automatically, there will not be any future comments.)

@thoughtpolice
Copy link
Contributor Author

This is an up-to-date refile of #750

));
// Mark artifact as uploaded and notify other potentially waiting tasks.
if upload_ret.is_ok() {
prev_uploads.alter(&digest, |_, _| OngoingUploadStatus::Done);
Copy link
Contributor

Choose a reason for hiding this comment

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

does prev_uploads grown unbounded? was expecting to see a removal here to keep it sized to the inflight digests

@thoughtpolice thoughtpolice force-pushed the aseipp/push-unoqptxykrwl branch from 21b8a52 to 7165604 Compare May 7, 2025 17:26
@thoughtpolice thoughtpolice force-pushed the aseipp/push-unoqptxykrwl branch 2 times, most recently from bc41b62 to 5b93158 Compare May 7, 2025 18:50
Currently, upload requests are handled in parallel without knowledge of
other ongoing requests. If multiple actions depend on the same set of
large locally available artifacts, then they will all be uploaded at
the same time. This is particularly poor behavior for large files.

Just store in-flight requests in a dashmap, and wait if an upload is
already extant.

Authored-by: Hugo van der Wijst <[email protected]>
Signed-off-by: Hugo van der Wijst <[email protected]>
Signed-off-by: Austin Seipp <[email protected]>
@thoughtpolice thoughtpolice force-pushed the aseipp/push-unoqptxykrwl branch from 5b93158 to 2b946ad Compare May 9, 2025 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants