aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java
diff options
context:
space:
mode:
authorGravatar olaola <olaola@google.com>2017-07-04 09:58:53 -0400
committerGravatar John Cater <jcater@google.com>2017-07-05 10:58:14 -0400
commitb259cc4491a6d43a3fe025d9de401f724373fca8 (patch)
tree106c35a2658d50aebab182989bc28b565d52e210 /src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java
parenta8a594323661f915c69f44e3d880a0c503234a74 (diff)
Allow the remote server to set its own default action timeout when Bazel does not have one. Hardcoded value of 120 seconds is clearly a mistake.
TESTED=remote worker PiperOrigin-RevId: 160891214
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.java7
1 files changed, 4 insertions, 3 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 46485771d4..4ec3610db0 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
@@ -98,8 +98,7 @@ final class RemoteSpawnRunner implements SpawnRunner {
spawn.getOutputFiles(),
Digests.computeDigest(command),
repository.getMerkleDigest(inputRoot),
- // TODO(olaola): set sensible local and remote timouts.
- Spawns.getTimeoutSeconds(spawn, 120));
+ Spawns.getTimeoutSeconds(spawn));
ActionKey actionKey = Digests.computeActionKey(action);
ActionResult result =
@@ -144,7 +143,9 @@ final class RemoteSpawnRunner implements SpawnRunner {
if (platform != null) {
action.setPlatform(platform);
}
- action.setTimeout(Duration.newBuilder().setSeconds(timeoutSeconds));
+ if (timeoutSeconds > 0) {
+ action.setTimeout(Duration.newBuilder().setSeconds(timeoutSeconds));
+ }
return action.build();
}