aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2018-03-27 08:15:39 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-03-27 08:17:53 -0700
commit4dd6f00db129c2082cedde84e20d23e852a0a2e6 (patch)
tree0bc47d5a0d5be2fb7659c64649b0ce86681185cb /src/main/java/com/google/devtools
parent0cafdfef8dcbde4aa556c93f05be85594c67656f (diff)
Ensure Runner name is always set.
RELNOTES: None. PiperOrigin-RevId: 190617155
Diffstat (limited to 'src/main/java/com/google/devtools')
-rw-r--r--src/main/java/com/google/devtools/build/lib/actions/SpawnResult.java1
-rw-r--r--src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnCache.java1
-rw-r--r--src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java3
3 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/actions/SpawnResult.java b/src/main/java/com/google/devtools/build/lib/actions/SpawnResult.java
index 10b484305a..e52f1cf623 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/SpawnResult.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/SpawnResult.java
@@ -360,6 +360,7 @@ public interface SpawnResult {
private String failureMessage = "";
public SpawnResult build() {
+ Preconditions.checkArgument(!runnerName.isEmpty());
if (status == Status.SUCCESS) {
Preconditions.checkArgument(exitCode == 0);
}
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 9b515d16a1..a9ceb14e1e 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
@@ -129,6 +129,7 @@ final class RemoteSpawnCache implements SpawnCache {
.setStatus(Status.SUCCESS)
.setExitCode(result.getExitCode())
.setCacheHit(true)
+ .setRunnerName("remote cache hit")
.build();
return SpawnCache.success(spawnResult);
}
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 bb858a924a..2700ba147e 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
@@ -169,6 +169,7 @@ class RemoteSpawnRunner implements SpawnRunner {
try {
return downloadRemoteResults(cachedResult, policy.getFileOutErr())
.setCacheHit(true)
+ .setRunnerName("remote cache hit")
.build();
} catch (CacheNotFoundException e) {
// No cache hit, so we fall through to local or remote execution.
@@ -210,7 +211,7 @@ class RemoteSpawnRunner implements SpawnRunner {
try {
return downloadRemoteResults(result, policy.getFileOutErr())
- .setRunnerName(remoteCacheHit ? "" : getName())
+ .setRunnerName(remoteCacheHit ? "remote cache hit" : getName())
.setCacheHit(remoteCacheHit)
.build();
} catch (IOException e) {