remote: close file when uploading
RELNOTES: None
@@ -92,8 +92,10 @@ public final class SimpleBlobStoreActionCache implements RemoteActionCache {
}
private Digest uploadFileContents(Path file) throws IOException, InterruptedException {
+ try (InputStream in = file.getInputStream()) {
// This unconditionally reads the whole file into memory first!
- return uploadBlob(ByteString.readFrom(file.getInputStream()).toByteArray());
+ return uploadBlob(ByteString.readFrom(in).toByteArray());
+ }
}
private Digest uploadFileContents(
