Skip to content

upload missing action inputs #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: hang-fix-patch
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import static com.google.devtools.build.lib.remote.util.RxUtils.mergeBulkTransfer;
import static com.google.devtools.build.lib.remote.util.RxUtils.toTransferResult;
import static java.lang.String.format;
import static java.util.concurrent.TimeUnit.SECONDS;

import build.bazel.remote.execution.v2.Digest;
import build.bazel.remote.execution.v2.Directory;
Expand All @@ -36,8 +37,6 @@
import com.google.devtools.build.lib.events.Reporter;
import com.google.devtools.build.lib.profiler.Profiler;
import com.google.devtools.build.lib.profiler.SilentCloseable;
import com.google.devtools.build.lib.remote.common.CacheNotFoundException;
import com.google.devtools.build.lib.remote.common.LostInputsEvent;
import com.google.devtools.build.lib.remote.common.RemoteActionExecutionContext;
import com.google.devtools.build.lib.remote.common.RemoteCacheClient;
import com.google.devtools.build.lib.remote.merkletree.MerkleTree;
Expand Down Expand Up @@ -157,7 +156,11 @@ public void ensureInputsPresent(
}));

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

var path = checkNotNull(file.getPath());
try {
if (remotePathChecker.isRemote(context, path)) {
// If we get here, the remote input was determined to exist in the remote or disk cache at
// some point before action execution, but reported to be missing when querying the remote
// for missing action inputs; possibly because it was evicted in the interim.
reporter.post(new LostInputsEvent(digest));
throw new CacheNotFoundException(digest, path.getPathString());
}
} catch (IOException e) {
return immediateFailedFuture(e);
}
return cacheProtocol.uploadFile(context, digest, path);
// try {
// if (remotePathChecker.isRemote(context, path)) {
// // If we get here, the remote input was determined to exist in the remote or disk cache at
// // some point before action execution, but reported to be missing when querying the remote
// // for missing action inputs; possibly because it was evicted in the interim.
// reporter.post(new LostInputsEvent(digest));
// throw new CacheNotFoundException(digest, path.getPathString());
// }
// } catch (IOException e) {
// return immediateFailedFuture(e);
// }
return cacheProtocol.uploadFile(context, digest, file.getPath());
}

Message message = additionalInputs.get(digest);
Expand Down
Loading