aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/remote/RemoteActionCache.java
diff options
context:
space:
mode:
authorGravatar Benjamin Peterson <bp@benjamin.pe>2017-06-27 14:41:26 +0200
committerGravatar Marcel Hlopko <hlopko@google.com>2017-06-27 15:06:59 +0200
commit9ef1521ca0def38156c39a25f6be29bdba0f4152 (patch)
treec91b563b762a261961486f74d48a3283cbdedc0e /src/main/java/com/google/devtools/build/lib/remote/RemoteActionCache.java
parent2e84e7ccba814253bf1402242c2ba6dab9293c6e (diff)
Enable connection pooling for the remote REST cache
Connection pooling is a useful optimization for REST caches that are far away as it avoids constantly redoing the TCP handshake. It also prevents large builds from exhausting the local interface's source ports through tens of thousands of one-transaction connections. The default connection pool size of 20 is fairly arbitrary. Users probably want to set this to something close to the value of --jobs. We introduce some generic infrastructure for closing remote cache instances and use it to cleanly shutdown the connection pool between builds. Change-Id: I73adc29ecae15cc10a1217ffbaa483892bcd4f9a PiperOrigin-RevId: 160264681
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/remote/RemoteActionCache.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/remote/RemoteActionCache.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/remote/RemoteActionCache.java b/src/main/java/com/google/devtools/build/lib/remote/RemoteActionCache.java
index 44a30f5745..994c23e1e6 100644
--- a/src/main/java/com/google/devtools/build/lib/remote/RemoteActionCache.java
+++ b/src/main/java/com/google/devtools/build/lib/remote/RemoteActionCache.java
@@ -74,4 +74,7 @@ interface RemoteActionCache {
*/
void upload(ActionKey actionKey, Path execRoot, Collection<Path> files, FileOutErr outErr)
throws IOException, InterruptedException;
+
+ /** Release resources associated with the cache. The cache may not be used after calling this. */
+ void close();
}