Remote: Don't call `FindMissingBlobs` when not uploading
If `--disk_cache` is used, along with `--incompatible_remote_results_ignore_disk` and `--noremote_upload_local_results`, results aren't uploaded to the remote cache, even if they are uploaded to the disk cache, so there is no reason to call `FindMissingBlobs`. This change removes that call when it's not needed.
Closes
@@ -103,10 +103,11 @@ public final class DiskAndRemoteCacheClient implements RemoteCacheClient {
@Override
public ListenableFuture<ImmutableSet<Digest>> findMissingDigests(
RemoteActionExecutionContext context, Iterable<Digest> digests) {
- ListenableFuture<ImmutableSet<Digest>> remoteQuery =
- remoteCache.findMissingDigests(context, digests);
ListenableFuture<ImmutableSet<Digest>> diskQuery =
diskCache.findMissingDigests(context, digests);
+ if (shouldUploadLocalResultsToRemoteCache(options, context.getSpawn())) {
+ ListenableFuture<ImmutableSet<Digest>> remoteQuery =
+ remoteCache.findMissingDigests(context, digests);
return Futures.whenAllSucceed(remoteQuery, diskQuery)
.call(
() ->
@@ -115,6 +116,9 @@ public final class DiskAndRemoteCacheClient implements RemoteCacheClient {
.addAll(diskQuery.get())
.build(),
MoreExecutors.directExecutor());
+ } else {
+ return diskQuery;
+ }
}
private Path newTempPath() {
