aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/remote
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
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')
-rw-r--r--src/main/java/com/google/devtools/build/lib/remote/CachedLocalSpawnRunner.java7
-rw-r--r--src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java7
-rw-r--r--src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnStrategy.java7
3 files changed, 12 insertions, 9 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/remote/CachedLocalSpawnRunner.java b/src/main/java/com/google/devtools/build/lib/remote/CachedLocalSpawnRunner.java
index 449b24c833..95a34042c3 100644
--- a/src/main/java/com/google/devtools/build/lib/remote/CachedLocalSpawnRunner.java
+++ b/src/main/java/com/google/devtools/build/lib/remote/CachedLocalSpawnRunner.java
@@ -96,8 +96,7 @@ final class CachedLocalSpawnRunner implements SpawnRunner {
spawn.getOutputFiles(),
Digests.computeDigest(command),
repository.getMerkleDigest(inputRoot),
- // TODO(olaola): set sensible local and remote timeouts.
- Spawns.getTimeoutSeconds(spawn, 120));
+ Spawns.getTimeoutSeconds(spawn));
// Look up action cache, and reuse the action output if it is found.
actionKey = Digests.computeActionKey(action);
@@ -147,7 +146,9 @@ final class CachedLocalSpawnRunner 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();
}
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();
}
diff --git a/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnStrategy.java b/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnStrategy.java
index 52cad13e21..871bc0cff5 100644
--- a/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnStrategy.java
+++ b/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnStrategy.java
@@ -148,7 +148,9 @@ final class RemoteSpawnStrategy implements SpawnActionContext {
if (platform != null) {
action.setPlatform(platform);
}
- action.setTimeout(Duration.newBuilder().setSeconds(timeoutSeconds));
+ if (timeoutSeconds > 0) {
+ action.setTimeout(Duration.newBuilder().setSeconds(timeoutSeconds));
+ }
return action.build();
}
@@ -247,8 +249,7 @@ final class RemoteSpawnStrategy implements SpawnActionContext {
spawn.getOutputFiles(),
Digests.computeDigest(command),
repository.getMerkleDigest(inputRoot),
- // TODO(olaola): set sensible local and remote timouts.
- Spawns.getTimeoutSeconds(spawn, 120));
+ Spawns.getTimeoutSeconds(spawn));
// Look up action cache, and reuse the action output if it is found.
actionKey = Digests.computeActionKey(action);