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

[7.1.0] Ensure that the mtime of an AC entry is smaller, not larger, than the CAS blobs it references. #21416

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@ public ListenableFuture<CachedActionResult> downloadActionResult(
}

return Futures.transformAsync(
// Update the mtime on the action result itself before any of the blobs it references.
// This ensures that the blobs are always newer than the action result, so that trimming the
// cache in LRU order cannot create dangling references.
Utils.downloadAsActionResult(actionKey, (digest, out) -> download(digest, out, Store.AC)),
actionResult -> {
if (actionResult == null) {
Expand All @@ -249,11 +252,6 @@ public ListenableFuture<CachedActionResult> downloadActionResult(
return immediateFuture(null);
}

// Update the mtime for the action result itself. This ensures that blobs are older than
// the action result, so that trimming the cache in LRU order will not create dangling
// references.
var unused = refresh(toPath(actionKey.getDigest(), Store.AC));

return immediateFuture(CachedActionResult.disk(actionResult));
},
MoreExecutors.directExecutor());
Expand Down
Loading