bazelbuild / bazelbuild/bazel

Dynamic spawn scheduler prevents remote cache from being populated

Open
#7,328 3 comments 3 reactions 0 assignees View on GitHub
not stale P3 team-Remote-Exec type: feature request
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

When a local action racing a remote action wins, the dynamic spawn scheduler cancels the remote action. As a result, we never populate the remote cache with the results of this cancelled action, and subsequent builds from the same or a different user cannot benefit from reuse.

An option here would be to make the dynamic spawn scheduler not cancel remote actions. This way they would eventually populate the cache and be reusable by other users/builds. But this would be inefficient because we'd leave some remote actions running when we know we don't truly care about their results.

Therefore, a better solution suggested by @philwo would be to delegate this "cancellation" to the remote execution service. The dynamic spawn scheduler should tell the remote service that it doesn't care about the action any longer (instead of forcibly canceling it), and the remote service would be in charge of deciding whether it wants to continue running the action if resources permit it or dropping it under pressure (or whichever other policy).

Filing under Bazel because we need to propagate this signal to the remote execution engine, which requires code changes and possibly some changes to the protocol. CC @buchgr

Contributor guide

Open the contributing guide

Research direction

Start by tracing cancellation in the dynamic spawn scheduler and following how it reaches the remote execution engine. Inspect the remote execution protocol and related entry points to determine how an uninterested signal can be propagated. Done means the scheduler no longer forcibly cancels the remote action, while the remote service can choose whether to continue and later populate the cache.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, distributed-systems
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.