|
47 | 47 | import com.google.devtools.build.lib.events.Reporter;
|
48 | 48 | import com.google.devtools.build.lib.profiler.Profiler;
|
49 | 49 | import com.google.devtools.build.lib.profiler.ProfilerTask;
|
| 50 | +import com.google.devtools.build.lib.remote.common.CacheNotFoundException; |
50 | 51 | import com.google.devtools.build.lib.remote.util.AsyncTaskCache;
|
51 | 52 | import com.google.devtools.build.lib.util.TempPathGenerator;
|
52 | 53 | import com.google.devtools.build.lib.vfs.FileSymlinkLoopException;
|
@@ -394,14 +395,24 @@ private ListenableFuture<Void> prefetchFile(
|
394 | 395 |
|
395 | 396 | Completable result =
|
396 | 397 | downloadFileNoCheckRx(
|
397 |
| - action, |
398 |
| - execRoot.getRelative(execPath), |
399 |
| - treeRootExecPath != null ? execRoot.getRelative(treeRootExecPath) : null, |
400 |
| - dirsWithOutputPermissions, |
401 |
| - input, |
402 |
| - metadata, |
403 |
| - priority, |
404 |
| - reason); |
| 398 | + action, |
| 399 | + execRoot.getRelative(execPath), |
| 400 | + treeRootExecPath != null ? execRoot.getRelative(treeRootExecPath) : null, |
| 401 | + dirsWithOutputPermissions, |
| 402 | + input, |
| 403 | + metadata, |
| 404 | + priority, |
| 405 | + reason) |
| 406 | + .onErrorResumeNext( |
| 407 | + t -> { |
| 408 | + if (t instanceof CacheNotFoundException cacheNotFoundException) { |
| 409 | + // Only the symlink itself is guaranteed to be an input to the action, so |
| 410 | + // report its path for rewinding. |
| 411 | + cacheNotFoundException.setExecPath(input.getExecPath()); |
| 412 | + return Completable.error(cacheNotFoundException); |
| 413 | + } |
| 414 | + return Completable.error(t); |
| 415 | + }); |
405 | 416 |
|
406 | 417 | if (symlink != null) {
|
407 | 418 | result = result.andThen(plantSymlink(symlink));
|
|
0 commit comments