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

Fix files being created even when download failed #885

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

cjreynol
Copy link
Collaborator

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

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
@cjreynol cjreynol added the kokoro:run Run e2e tests. label Feb 13, 2025
@cjreynol cjreynol self-assigned this Feb 13, 2025
@cjreynol cjreynol enabled auto-merge February 13, 2025 06:04
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed the kokoro:run Run e2e tests. label Feb 13, 2025
@cjreynol cjreynol added this pull request to the merge queue Feb 13, 2025
Merged via the queue into google:main with commit 99ba695 Feb 13, 2025
11 checks passed
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.

3 participants