Skip to content

Commit

Permalink
Add timeout to blockingAwait
Browse files Browse the repository at this point in the history
as a workaround for bazelbuild#19513.

PiperOrigin-RevId: 569152388
Change-Id: I51e64f4708fc62ca3078290231e4195a081855df
  • Loading branch information
coeuvre authored and copybara-github committed Sep 28, 2023
1 parent 990f3fd commit 95d6ccc
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,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 Down Expand Up @@ -112,7 +113,10 @@ public void ensureInputsPresent(
}));

try {
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

0 comments on commit 95d6ccc

Please sign in to comment.