Skip to content

Clean up temporary files after failed GCP cache downloads - #80

Open
dajiaohuang wants to merge 1 commit into
androidx:mainfrom
dajiaohuang:fix/cleanup-failed-gcp-cache-download
Open

dajiaohuang wants to merge 1 commit into
androidx:mainfrom
dajiaohuang:fix/cleanup-failed-gcp-cache-download

Conversation

@dajiaohuang

Copy link
Copy Markdown

Summary

Large-object GCP cache downloads write to a temporary file before Blob.downloadTo. If the download fails, the cache service reports a miss but previously left the partial temporary file behind. This change deletes that file on failure while preserving the original exception; any cleanup exception is attached as suppressed.

A synthetic unit test writes partial contents, throws an IOException, and verifies the file is gone and the original exception is propagated.

Validation

  • ./gradlew jar check --no-daemon --stacktrace — passed (Gradle 9.7.1, JDK 17).
  • GCP Storage integration tests were skipped because GRADLE_CACHE_SERVICE_ACCOUNT_PATH was unset. No real GCP credentials, buckets, metadata endpoint, or cloud operations were used.
  • The GCP functional test and S3 tests (using the repository's local mock server) ran as part of check.

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.

1 participant