Skip to content

Commit

Permalink
Rename the remote_cache_hit field to cache_hit, which more accurately…
Browse files Browse the repository at this point in the history
… 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 bazelbuild/bazel#19904).

Progress on bazelbuild/bazel#18643.

PiperOrigin-RevId: 582294420
  • Loading branch information
tjgq authored and copybara-github committed Nov 14, 2023
1 parent ab4d2a1 commit 0bc8e5f
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions third_party/bazel/src/main/protobuf/spawn.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 0bc8e5f

Please sign in to comment.