diff options
author | olaola <olaola@google.com> | 2017-12-11 07:53:15 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2017-12-11 07:57:24 -0800 |
commit | a22d0e9c14e58b29d81f5a83bdcc6e5fce52eafe (patch) | |
tree | 305828b0cc64d6b9564b23ca311704abde8a9335 /src/tools/remote | |
parent | 180d25660cc5b1272497e30a1cdc494ac5eadf77 (diff) |
Fix: uploading artifacts of failed actions to remote cache stopped working.
To reproduce: run a failing test with --experimental_remote_spawn_cache or with --spawn_strategy=remote and no executor. Expected: test log is uploaded.
Desired behavior:
- regardless of whether a spawn is cacheable or not, its artifacts should be uploaded to the remote cache.
- the spawn result should only be set if the spawn is cacheable *and* the action succeeded.
- when executing remotely, the do_not_cache field should be set for non-cacheable spawns, and the remote execution engine should respect it.
This CL contains multiple fixes to ensure the above behaviors, and adds a few tests, both end to end and unit tests. Important behavior change: it is no longer assumed that non-cacheable spawns should use a NO_CACHE SpawnCache! The appropriate test case was removed. Instead, an assumption was added that all implementations of SpawnCache should respect the Spawns.mayBeCached(spawn) property. Currently, only NO_CACHE and RemoteSpawnCache exist, and they (now) support it.
TESTED=remote build execution backend.
WANT_LGTM: philwo,buchgr
RELNOTES: None
PiperOrigin-RevId: 178617937
Diffstat (limited to 'src/tools/remote')
-rw-r--r-- | src/tools/remote/src/main/java/com/google/devtools/build/remote/worker/ExecutionServer.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/remote/src/main/java/com/google/devtools/build/remote/worker/ExecutionServer.java b/src/tools/remote/src/main/java/com/google/devtools/build/remote/worker/ExecutionServer.java index e80257b5b0..22761a9b19 100644 --- a/src/tools/remote/src/main/java/com/google/devtools/build/remote/worker/ExecutionServer.java +++ b/src/tools/remote/src/main/java/com/google/devtools/build/remote/worker/ExecutionServer.java @@ -267,7 +267,7 @@ final class ExecutionServer extends ExecutionImplBase { byte[] stderr = cmdResult.getStderr(); cache.uploadOutErr(result, stdout, stderr); ActionResult finalResult = result.setExitCode(exitCode).build(); - if (exitCode == 0) { + if (exitCode == 0 && !action.getDoNotCache()) { ActionKey actionKey = digestUtil.computeActionKey(action); cache.setCachedActionResult(actionKey, finalResult); } |