|
23 | 23 | import static com.google.devtools.build.lib.remote.util.RxUtils.mergeBulkTransfer; |
24 | 24 | import static com.google.devtools.build.lib.remote.util.RxUtils.toTransferResult; |
25 | 25 | import static java.lang.String.format; |
| 26 | +import static java.util.concurrent.TimeUnit.SECONDS; |
26 | 27 |
|
27 | 28 | import build.bazel.remote.execution.v2.Digest; |
28 | 29 | import build.bazel.remote.execution.v2.Directory; |
|
36 | 37 | import com.google.devtools.build.lib.events.Reporter; |
37 | 38 | import com.google.devtools.build.lib.profiler.Profiler; |
38 | 39 | 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; |
41 | 40 | import com.google.devtools.build.lib.remote.common.RemoteActionExecutionContext; |
42 | 41 | import com.google.devtools.build.lib.remote.common.RemoteCacheClient; |
43 | 42 | import com.google.devtools.build.lib.remote.merkletree.MerkleTree; |
@@ -157,7 +156,11 @@ public void ensureInputsPresent( |
157 | 156 | })); |
158 | 157 |
|
159 | 158 | 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 | + } |
161 | 164 | } catch (RuntimeException e) { |
162 | 165 | Throwable cause = e.getCause(); |
163 | 166 | if (cause != null) { |
@@ -186,18 +189,18 @@ private ListenableFuture<Void> uploadBlob( |
186 | 189 | } |
187 | 190 |
|
188 | 191 | 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()); |
201 | 204 | } |
202 | 205 |
|
203 | 206 | Message message = additionalInputs.get(digest); |
|
0 commit comments