Adjust cache_content_behavior="fetch"
to skip loading of data
#17448
Labels
cache_content_behavior="fetch"
to skip loading of data
#17448
As reported as one part of #16825 (comment),
cache_content_behavior="fetch"
is pretty wasteful when used with a local cache, because it actually loads the content from disk, rather than only validating that it exists.The
cache_content_behavior
check lives here: https://github.com/pantsbuild/pants/blob/main/src/rust/engine/process_execution/src/lib.rs#L822-L873 ... and usesensure_local_has_recursive_directory
andensure_local_has_file
to"fetch"
content from the remote store to the local store.ensure_local_has_file
internally usesload_bytes_with
to fetch content... but this is overkill.To improve this:
ensure_local_has_file
should be converted into a batch method (probably:ensure_local_has_files
)ensure_local_has_files
should start by using the batch exists check from Implement a batched local lookup for missing fingerprints. #16627 to filter out anyDigest
s which already exist locally.load_bytes_with
for the portion which actually downloads aDigest
:pants/src/rust/engine/fs/store/src/lib.rs
Lines 680 to 721 in 4050ad0
ensure_local_has_files
to download the content.The text was updated successfully, but these errors were encountered: