aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java b/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java
index f09d496a31..9fe489a7c4 100644
--- a/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java
+++ b/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java
@@ -118,6 +118,11 @@ class RemoteSpawnRunner implements SpawnRunner {
? remoteCache.getCachedActionResult(actionKey)
: null;
if (cachedResult != null) {
+ if (cachedResult.getExitCode() != 0) {
+ // The remote cache must never serve a failed action.
+ throw new EnvironmentalExecException("The remote cache is in an invalid state as it"
+ + " served a failed action. Hash of the action: " + actionKey.getDigest());
+ }
try {
return downloadRemoteResults(cachedResult, policy.getFileOutErr());
} catch (CacheNotFoundException e) {