Skip to content
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

Avoid redundant work while hackily_snapshot()ing. #7829

Merged

Conversation

stuhood
Copy link
Sponsor Member

@stuhood stuhood commented May 31, 2019

Problem

In runs with high degrees of concurrency, we end up seeing many simultaneous instances of tools being fetched and snapshotted.

Solution

Enforce a single fetch+snapshot attempt per tool. As mentioned in the comment, this is a temporary solution until #7790 migrates this into the engine itself.

src/python/pants/binaries/binary_tool.py Outdated Show resolved Hide resolved
@stuhood stuhood force-pushed the stuhood/memoize-snapshotting-in-binary-util branch from 3f23f64 to bef33a3 Compare May 31, 2019 23:16
Copy link
Contributor

@cosmicexplorer cosmicexplorer left a comment

Choose a reason for hiding this comment

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

Not super familiar with threading but this seems ideal! I would love to add a test which exercises the possibility of a multithreaded download (what this PR fixes), especially since that test would seem to still work upon conversion to v2 -- is there an easy way to do that by just kicking off two threads downloading a tool at once? If a test for that isn't easy or is likely to be flaky then I would love a TODO about that at least so we clearly know what things aren't being tested yet.

@cosmicexplorer
Copy link
Contributor

Restarted a failing contrib shard!

@stuhood stuhood merged commit d3c9311 into pantsbuild:master Jun 1, 2019
@stuhood
Copy link
Sponsor Member Author

stuhood commented Jun 1, 2019

I would love to add a test which exercises the possibility of a multithreaded download (what this PR fixes), especially since that test would seem to still work upon conversion to v2 -- is there an easy way to do that by just kicking off two threads downloading a tool at once?

That would end up being a test of the rust Graph itself, rather than of downloading things. So while I agree that the test might be useful right now, it would not be in that future.

@stuhood stuhood deleted the stuhood/memoize-snapshotting-in-binary-util branch June 1, 2019 04:19
stuhood added a commit that referenced this pull request Jun 1, 2019
### Problem

In runs with high degrees of concurrency, we end up seeing many simultaneous instances of tools being fetched and snapshotted.

### Solution

Enforce a single fetch+snapshot attempt per tool. As mentioned in the comment, this is a temporary solution until #7790 migrates this into the engine itself.
stuhood added a commit that referenced this pull request Jun 1, 2019
### Problem

In runs with high degrees of concurrency, we end up seeing many simultaneous instances of tools being fetched and snapshotted.

### Solution

Enforce a single fetch+snapshot attempt per tool. As mentioned in the comment, this is a temporary solution until #7790 migrates this into the engine itself.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants