diff --git a/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnCache.java b/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnCache.java index 2da0cc1203d446..6f99064a21a760 100644 --- a/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnCache.java +++ b/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnCache.java @@ -142,7 +142,7 @@ public CacheHandle lookup(Spawn spawn, SpawnExecutionContext context) try (SilentCloseable c = Profiler.instance().profile("RemoteCache.getCachedActionResult")) { result = remoteCache.getCachedActionResult(actionKey); } - if (result != null) { + if (result != null && (result.getOutputFilesCount() + result.getOutputDirectoriesCount() > 0)) { // We don't cache failed actions, so we know the outputs exist. // For now, download all outputs locally; in the future, we can reuse the digests to // just update the TreeNodeRepository and continue the build.