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

Projects
None yet
3 participants
@stuhood
Copy link
Member

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.

@stuhood stuhood added this to the 1.16.x milestone May 31, 2019

Show resolved Hide resolved src/python/pants/binaries/binary_tool.py Outdated

@stuhood stuhood force-pushed the twitter:stuhood/memoize-snapshotting-in-binary-util branch from 3f23f64 to bef33a3 May 31, 2019

@cosmicexplorer
Copy link
Contributor

left a comment

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

This comment has been minimized.

Copy link
Contributor

commented Jun 1, 2019

Restarted a failing contrib shard!

@stuhood stuhood merged commit d3c9311 into pantsbuild:master Jun 1, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@stuhood

This comment has been minimized.

Copy link
Member Author

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 twitter:stuhood/memoize-snapshotting-in-binary-util branch Jun 1, 2019

stuhood added a commit that referenced this pull request Jun 1, 2019

Avoid redundant work while hackily_snapshot()ing. (#7829)
### 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

Avoid redundant work while hackily_snapshot()ing. (#7829)
### 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
You can’t perform that action at this time.