From 0bc8e5fe7ffaeee170fb09d6cc5b4886a1bbd03c Mon Sep 17 00:00:00 2001 From: Tiago Quelhas Date: Tue, 14 Nov 2023 06:02:30 -0800 Subject: [PATCH] Rename the remote_cache_hit field to cache_hit, which more accurately reflects its purpose. Also amend misleading or plainly incorrect comments. In particular, the runner field is always populated, even for cache hits, and spawns are only missing when the persistent action cache is hit ("local" is ambiguous, as we also use it in certain places to refer to the disk cache). Note that, while the runner and cache_hit fields currently overlap in purpose, their separate existence is better aligned with potential future plans to promote cache lookups to a strategy (see https://github.com/bazelbuild/bazel/issues/19904). Progress on https://github.com/bazelbuild/bazel/issues/18643. PiperOrigin-RevId: 582294420 --- .../bazel/src/main/protobuf/spawn.proto | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/third_party/bazel/src/main/protobuf/spawn.proto b/third_party/bazel/src/main/protobuf/spawn.proto index ce028cfd383..160e9302f49 100644 --- a/third_party/bazel/src/main/protobuf/spawn.proto +++ b/third_party/bazel/src/main/protobuf/spawn.proto @@ -145,21 +145,23 @@ message SpawnExec { // The outputs generated by the execution. repeated File actual_outputs = 11; - // If the Spawn was actually executed, rather than a cache hit, - // this will be the name of the runner executing the spawn, e.g. remote or - // linux-sandbox. If it was a remote cache hit, the runner will be - // "remote cache hit". If it was a local cache hit, the action will not be - // included in the log in the first place. + // If the spawn did not hit a disk or remote cache, this will be the name of + // the runner, e.g. "remote", "linux-sandbox" or "worker". // - // Note, this is not the same as the "strategy" string -- even - // though the action strategy may be remote. A particular action may still - // fall back to local execution due to a variety of reasons. This field - // indicates what really happened for the particular Spawn+execution. + // If the spawn hit a disk or remote cache, this will be "disk cache hit" or + // "remote cache hit", respectively. This includes the case where a remote + // cache was hit while executing the spawn remotely. + // + // Note that spawns whose owning action hits the persistent action cache + // are never reported at all. + // + // This won't always match the spawn strategy. For the dynamic strategy, it + // will be the runner for the first branch to complete. For the remote + // strategy, it might be a local runner in case of a fallback. string runner = 12; - // Whether the Spawn was a remote cache hit, in which case it was not executed - // and the runner field will be empty. - bool remote_cache_hit = 13; + // Whether the spawn hit a disk or remote cache. + bool cache_hit = 13; // A text status returned by the execution, in case there were any errors. // Empty in case of successful execution.