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.java16
1 files changed, 12 insertions, 4 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 7b6971623c..7ba5e5edf7 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
@@ -42,6 +42,7 @@ import java.util.Collection;
import java.util.List;
import java.util.SortedMap;
import java.util.TreeSet;
+import javax.annotation.Nullable;
/** A client for the remote execution service. */
@ThreadSafe
@@ -52,15 +53,15 @@ final class RemoteSpawnRunner implements SpawnRunner {
private final Platform platform;
private final SpawnRunner fallbackRunner;
- private final RemoteActionCache remoteCache;
- private final GrpcRemoteExecutor remoteExecutor;
+ @Nullable private final RemoteActionCache remoteCache;
+ @Nullable private final GrpcRemoteExecutor remoteExecutor;
RemoteSpawnRunner(
Path execRoot,
RemoteOptions options,
SpawnRunner fallbackRunner,
- RemoteActionCache remoteCache,
- GrpcRemoteExecutor remoteExecutor) {
+ @Nullable RemoteActionCache remoteCache,
+ @Nullable GrpcRemoteExecutor remoteExecutor) {
this.execRoot = execRoot;
this.options = options;
this.platform = options.parseRemotePlatformOverride();
@@ -210,4 +211,11 @@ final class RemoteSpawnRunner implements SpawnRunner {
}
return result;
}
+
+ /** Release resources associated with this spawn runner. */
+ public void close() {
+ if (remoteCache != null) {
+ remoteCache.close();
+ }
+ }
}