Refactor SkyframeActionExecutor

Move all action state tracking to a new subclass, which replaces the
use of Pair+FutureTask, and carefully ensures that we don't hold onto
memory for any longer than necessary.

This is another attempt at preparing for async action execution. A
similar refactoring was previously attempted in https://github.com/bazelbuild/bazel/commit/14f8b109b9f987f1b0c69c8cf399326740749382, but had to
be rolled back as https://github.com/bazelbuild/bazel/commit/68fc46b7ac2a015cbbd4e6602f2310a935783866 due to increased memory consumption.

The new code may seem a bit overengineered given that the current
implementation requires exactly two states:
STARTED -> DONE

However, async actions will have at least three, and possibly more
states, which requires a bit more infrastructure here:
STARTED -> IN_PROGRESS -> DONE

Note that we need to explicitly model the intermediate state such that
parallel threads due to action sharing can see the IN_PROGRESS state,
and register their dependency on the corresponding Future (code in a
subsequent commit).

Progress on #6394.

PiperOrigin-RevId: 234469209
2 files changed
tree: 21fd6a8d4a7617f8d0d5202ddeda2cd9a8420128
  1. .bazelci/
  2. examples/
  3. scripts/
  4. site/
  5. src/
  6. third_party/
  7. tools/
  8. .gitattributes
  9. .gitignore
  10. AUTHORS
  11. BUILD
  12. CHANGELOG.md
  13. CODEOWNERS
  14. combine_distfiles.py
  15. combine_distfiles_to_tar.sh
  16. compile.sh
  17. CONTRIBUTING.md
  18. CONTRIBUTORS
  19. distdir.bzl
  20. ISSUE_TEMPLATE.md
  21. LICENSE
  22. README.md
  23. WORKSPACE
README.md

Bazel

{Fast, Correct} - Choose two

Build and test software of any size, quickly and reliably.

  • Speed up your builds and tests: Bazel only rebuilds what is necessary. With advanced local and distributed caching, optimized dependency analysis and parallel execution, you get fast and incremental builds.

  • One tool, multiple languages: Build and test Java, C++, Android, iOS, Go, and a wide variety of other language platforms. Bazel runs on Windows, macOS, and Linux.

  • Scalable: Bazel helps you scale your organization, codebase, and continuous integration solution. It handles codebases of any size, in multiple repositories or a huge monorepo.

  • Extensible to your needs: Easily add support for new languages and platforms with Bazel's familiar extension language. Share and re-use language rules written by the growing Bazel community.

Getting Started

Documentation

Contributing to Bazel

See CONTRIBUTING.md

Build status

Bazel is released in ‘Beta’. See the product roadmap to learn about the path toward a stable 1.0 release.