Repository navigation
Persistent workers: a configurable pool with an idle sweeper, the action environment, namespaces, measured usage, and a wait at the cap - #2830
Merged
Conversation
…ion environment, namespaces, measured usage, and a wait at the cap
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
corcillo
reviewed
Sep 30, 2026
corcillo
reviewed
Sep 30, 2026
corcillo
reviewed
Sep 30, 2026
corcillo
reviewed
Sep 30, 2026
corcillo
reviewed
Sep 30, 2026
corcillo
reviewed
Sep 30, 2026
… cap is raced against the kill and bounded by the action's time, CPU as a delta, one environment helper, the pool on by default
…r-pool # Conflicts: # web/apps/docs/content/docs/reference/nativelink-config/main.mdx
corcillo
previously approved these changes
Sep 30, 2026
corcillo
approved these changes
Sep 30, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
The persistent worker pool had no configuration, no idle reaping, and served an action without its environment, outside the worker's namespaces and with no usage reported.
persistent_workerson the worker config now sizes it:max_workers_per_key(default 4),idle_timeout_s(default 300, a sweeper retires a process idle past it),max_requests_per_worker(default 200),shutdown_grace_msandacquire_timeout_s. The pool key carries the executable, its arguments, the environment and the protocol; the process starts with the worker'sadditional_environment(the sources that are the same for every action) and the action's own variables on top, as a one-shot action does, a process is spawned in the same namespaces as a one-shot action, its measured usage goes into the result, and an action at the cap waitsacquire_timeout_s(default 30) for a returned process before it runs one-shot; that wait is raced against the scheduler's kill and bounded by the action's own timeout, which the dispatch then gets the remainder of. The key's Debug prints environment names, never values, since it is logged and quoted in errors; the CPU reported for a pooled action is the process's spend from the moment sampling began, and its peak memory is documented as a whole-process figure.How was this verified?
Pool tests: the key tells environments apart and ignores their order, the sweeper retires a worker idle past the timeout, and an acquire at the cap waits for a returned worker. The running actions manager tests build the configuration with the new settings, the persistent workers page and the config reference are updated, and the snippet lint passes.
Risk
PersistentWorkersConfig::default()has the pool on, as the serde default and the docs say. Defaults match what the pool did before, except that the sweeper now retires a process idle for five minutes and an action at the cap waits up to thirty seconds before falling back. A pooled process stays outside soft memory enforcement, as the enforcement docs say.AI assistance
An agent drafted the change and I reviewed every line.
This change is