Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix files being created even when download failed
This was causing failures during repeated fetches when the first fails to download files. `HttpClient` was creating a temporary file under a unique name as a placeholder, then the download would fail and not write anything to that temp file, and finally it would rename that file to the expected name. The bad file existing was triggering a cache hit and causing failures once the files could not be extracted from. Preventing the rename is not thorough enough, because the temporary files were still left in the cache. Bug: 395979597 Test: cvd fetch --target_directory=/tmp/cvd/cache_test --default_build=11407015/cf_x86_64_phone-userdebug_coverage Test: # expected failure becaue the file is not found Test: ls /tmp/cvd/cache_test # no host tools or images Test: ls /tmp/cvd/cache/<user_id>/11407015/cf_x86_64_phone-userdebug_coverage Test: # directories for build+target exist, but no files leftover
- Loading branch information