Skip to content

Commit 7da7475

Browse files
committed
upload missing action inputs
1 parent 97decba commit 7da7475

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

src/main/java/com/google/devtools/build/lib/remote/RemoteExecutionCache.java

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import static com.google.devtools.build.lib.remote.util.RxUtils.mergeBulkTransfer;
2424
import static com.google.devtools.build.lib.remote.util.RxUtils.toTransferResult;
2525
import static java.lang.String.format;
26+
import static java.util.concurrent.TimeUnit.SECONDS;
2627

2728
import build.bazel.remote.execution.v2.Digest;
2829
import build.bazel.remote.execution.v2.Directory;
@@ -36,8 +37,6 @@
3637
import com.google.devtools.build.lib.events.Reporter;
3738
import com.google.devtools.build.lib.profiler.Profiler;
3839
import com.google.devtools.build.lib.profiler.SilentCloseable;
39-
import com.google.devtools.build.lib.remote.common.CacheNotFoundException;
40-
import com.google.devtools.build.lib.remote.common.LostInputsEvent;
4140
import com.google.devtools.build.lib.remote.common.RemoteActionExecutionContext;
4241
import com.google.devtools.build.lib.remote.common.RemoteCacheClient;
4342
import com.google.devtools.build.lib.remote.merkletree.MerkleTree;
@@ -157,7 +156,11 @@ public void ensureInputsPresent(
157156
}));
158157

159158
try {
160-
mergeBulkTransfer(uploads).blockingAwait();
159+
//mergeBulkTransfer(uploads).blockingAwait();
160+
// Workaround for https://github.com/bazelbuild/bazel/issues/19513.
161+
if (!mergeBulkTransfer(uploads).blockingAwait(options.remoteTimeout.getSeconds(), SECONDS)) {
162+
throw new IOException("Timed out when waiting for uploads");
163+
}
161164
} catch (RuntimeException e) {
162165
Throwable cause = e.getCause();
163166
if (cause != null) {
@@ -186,18 +189,18 @@ private ListenableFuture<Void> uploadBlob(
186189
}
187190

188191
var path = checkNotNull(file.getPath());
189-
try {
190-
if (remotePathChecker.isRemote(context, path)) {
191-
// If we get here, the remote input was determined to exist in the remote or disk cache at
192-
// some point before action execution, but reported to be missing when querying the remote
193-
// for missing action inputs; possibly because it was evicted in the interim.
194-
reporter.post(new LostInputsEvent(digest));
195-
throw new CacheNotFoundException(digest, path.getPathString());
196-
}
197-
} catch (IOException e) {
198-
return immediateFailedFuture(e);
199-
}
200-
return cacheProtocol.uploadFile(context, digest, path);
192+
// try {
193+
// if (remotePathChecker.isRemote(context, path)) {
194+
// // If we get here, the remote input was determined to exist in the remote or disk cache at
195+
// // some point before action execution, but reported to be missing when querying the remote
196+
// // for missing action inputs; possibly because it was evicted in the interim.
197+
// reporter.post(new LostInputsEvent(digest));
198+
// throw new CacheNotFoundException(digest, path.getPathString());
199+
// }
200+
// } catch (IOException e) {
201+
// return immediateFailedFuture(e);
202+
// }
203+
return cacheProtocol.uploadFile(context, digest, file.getPath());
201204
}
202205

203206
Message message = additionalInputs.get(digest);

0 commit comments

Comments
 (0)