-
-
Notifications
You must be signed in to change notification settings - Fork 644
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use ThreadPool for cache fetching and rust tar for artifact extration (…
…#6748) ### Problem https://github.com/pantsbuild/pants/blob/11aa11f2a3abc865e32a9f513abed4a3877b9272/src/python/pants/cache/restful_artifact_cache.py#L75 would hang and thus never exiting the multiprocessing pool. The closest issue I can find is https://stackoverflow.com/questions/25943923/requests-get-hangs-when-called-in-a-multiprocessing-pool which doesn't have any solution. I was able to repro the issue almost consistently with PyCharm debug mode with ``` clean-all compile --cache-read-from="https://dummy_url/" examples/tests/java/org/pantsbuild/example/hello/greet/: ... [zinc] [cache] (stuck here) ``` and the issue seems to be resolved by using `ThreadPool`. # Solution Since most of the untar work was done in Python and was CPU bound, we chose to move that to rust for the performance.
- Loading branch information
1 parent
fc53162
commit c83f6f1
Showing
14 changed files
with
284 additions
and
46 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[package] | ||
name = "tar_api" | ||
version = "0.0.1" | ||
authors = [ "Pants Build <[email protected]>" ] | ||
|
||
[lib] | ||
path = "src/tar_api.rs" | ||
|
||
[dependencies] | ||
flate2 = "1.0" | ||
tar = "0.4.20" | ||
|
||
[dev-dependencies] | ||
tempfile = "3" | ||
testutil = { path = "../testutil" } |
Oops, something went wrong.