Repository navigation
Description
Agent: buildkit-lead
What this is
A measured limitation of the BuildKit adoption's daemon, filed because it is a user-facing wart with a design cost, not a detail: a daemon-level setting cannot be applied while the daemon is running.
Found while landing leg 4-pre (opencharly/sdk#395, the kit extension that makes the renamed stage_parallelism reach the daemon config).
The setting, and why it is daemon-level
podman build --jobs N — the knob the cutover renamed to stage_parallelism — bounded the concurrent stages of one build. BuildKit's client has no per-build equivalent; the daemon's own surface has the successor (its flag help, measured):
$ buildkitd --help | grep -i parallel
--oci-max-parallelism int limit the number of parallel build steps that can run at the same time (default: 0)
--containerd-max-parallelism int limit the number of parallel build steps that can run at the same time (default: 0)
So the value is rendered into [worker.oci] max-parallelism by sdk/buildkitdrive at daemon start, and a running daemon cannot adopt a new one.
The wart, as a user meets it
Whoever starts the daemon first fixes the value. A no-opinion caller that starts the daemon — the VM-box emit path, which has no parallelism input of its own — writes the default config (no max-parallelism key). A later opinionated charly box build then gets:
buildkitdrive: the running daemon was configured with max-parallelism=0 but 8 was requested;
the value is set at daemon start, so stop the daemon
(/run/user/1000/charly/buildkitd.sock) and this drive will start it with the new value
That is honest and actionable — the alternative (silently running with the wrong value) would be worse — but it asks the user to stop a daemon by hand, which no charly verb currently offers for this daemon.
Why it is not fixable in the kit: the daemon has no process to own (measured)
A restart is the obvious remedy, and it was implemented and then removed, because there is no process to own:
- the daemon is a detached
rootlesskittree that re-execs itself — the process table shows the wrapper and a/proc/self/exechild carrying identical args. There is no single pid to record, probe or signal, and a liveness probe on the recorded parent calls a live daemon dead (observed directly:Ensureaborted in 0.00s reporting "the daemon exited" while the daemon was running and later servedbuildctl debug workers). - Four restart variants were tried; each failed on that identity problem in a different costume:
- a false-positive restart — reported as applied while the original daemon kept the socket, so the config claimed a value no running daemon had;
- the stale state-dir lock —
failed to lock …/rootlesskit-state/lock, another RootlessKit is running with the same state directory?; - a socket file that outlives its daemon —
connection refusedon a file that still exists, so waiting for the file to vanish times out against a daemon already gone; - an unowned daemon answering that the kit has no record of — where killing it would mean killing a process we do not own.
The remedy direction, and its cost
Applying a changed daemon-level setting reliably needs a supervisor: the plan's option (b), a charly-managed host unit (reusing the existing engine provider unit_emit op, which already renders charly-<name>.service from a start_argv) instead of the current on-demand daemon.
That is a revision of decision D-2 of the BuildKit adoption plan, and it is not free: a long-lived supervised daemon is a persistent host artifact, which is precisely what D-2 declined when it chose the on-demand, drive-owned daemon (the measured restart-persistence of the daemon's own --root removed the only reason a long-lived one was thought necessary). Reversing it therefore carries:
- the host unit itself, and the
charlyverb(s) to install/start/stop/show it; - a packaging leg — the unit is a new thing charly installs on a host, so
packaging/charly.yml's dependency and file lists move with it, on all five format families; - a change to the daemon's lifetime semantics: currently bounded by the last builder process, afterwards persistent across reboots.
What is NOT owed here
- The current behaviour is not silent and not a false success: the mismatch is a named error naming the running value, the requested value, the socket, and the remedy. Nothing needs to be un-shipped.
- The value does reach the daemon on the ordinary path — with no daemon running, the caller with an opinion writes the config and the daemon starts with it (proven live:
cold start want=4 → config=4,workers=true). - This is not a defect in the kit's diff: it is the consequence of two earlier rulings (the daemon-level mapping, and D-2's on-demand shape) meeting.
Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (analysed on a live system)
Activity
fix(sdk): drop the dead PidName constant, and the wart it belonged to…
feat(sdk): the daemon config carries the resolved stage parallelism (…
aitrawog commentedon Oct 14, 2026
STATUS — the wart is filed, its mechanism is landed, and its next step is an operator decision — recorded here so this thread names both the current behaviour and what would change it.
What ships today (
sdk#395→69a36fb, tagv0.2026287.2154, merged): the daemon's[worker.oci] max-parallelismnow carries the resolvedstage_parallelismon the ordinary path — with no daemon running, the caller with an opinion writes the config and the daemon starts with it (cold start want=4 → config=4, proven live). A changed value while a daemon is running is reported, not force-applied: "the running daemon was configured with max-parallelism=4 but 8 was requested; the value is set at daemon start, so stop the daemon (…) and this drive will start it with the new value." Nothing silent, nothing unactionable.Why it is reported rather than applied — the measured negative result: the daemon is a detached
rootlesskittree that re-execs itself, so there is no single pid to record, probe or signal. A liveness probe on the recorded parent reports a live daemon as dead (observed directly). Four restart variants each failed on that identity problem in a different costume: a false-positive restart whose config claimed a value no daemon had; the stale rootlesskit state-dir lock; a socket file that persists while the daemon is gone (connection refusedon a file that still exists); and an unowned daemon we must not kill.The wart, named: whoever starts the daemon first fixes the value — e.g. a VM-box emit (no opinion) before a
box build(opinion) yields the mismatch error until the daemon is stopped.Next step, and it needs operator direction because it reverses a design ruling: the reliable fix is a supervisor (
systemd --userunit, restarted by the drive when the value changes) — the plan's option (b), declined at D-2 precisely to avoid a persistent host artifact. Taking it means (1) revising D-2, and (2) a packaging leg that owns the unit andpackaging/charly.yml. Until then the shipped behaviour above is the design, and the wart is a known consequence rather than an oversight.How this was caught, for the record: the round's three findings were one class — an artefact describing something the tree does not do — and this slot was the one the R1 pass was missing: it covered failures and had none for shipped limitations. Honesty in the body is not the filing.
Agent:
leadAssisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (analysed on a live system)
aitrawog commentedon Oct 28, 2026
STATUS — the knob's SCOPE is measured now, and it is host-global, not per-project. This is added here rather than filed as a new issue because the remedy direction is the one this thread already names (a supervisor / a host-scoped setting).
Measured live (2026-10-28, this host). The renamed key is honored end to end: a project manifest carrying
defaults.stage_parallelism_cap: 8makes the build ask the daemon formax-parallelism=8, and the running daemon (configured at 4) refuses by name:What that measures. The knob is the daemon's
[worker.oci] max-parallelism— set at daemon START, per uid (socket/run/user/1000/charly/buildkitd.sock, state$XDG_CACHE_HOME/charly/buildkitd) — not per project. The retiredpodman_jobs/podman_jobs_capwere silently DROPPED by the decoder, so every project in the org asked for the same fallback (StageParallelismCapFallback = 4,sdk/buildkit/build_helpers.go) and never collided. The moment a project's config is honored, the org's projects share ONE value, and a project whose cap differs from the running daemon's cannot build at all.The scope finding this adds. The knob's CONFIGURATION is project-local (
defaults:in each project'scharly.yml) while its EFFECT is host-global. Two projects declaring different caps fight over one daemon: the first to start it fixes the value for every other project, and the others then fail with exactly the message above. So the value is not a per-project knob and should not be authored as one — the org needs ONE agreed host value and a host-scoped surface for it, which is the supervisor direction this issue already names.A concrete consequence in the migration path.
charly migraterenames the retired keys and carries the author's value verbatim (plugin-migratemigrations.cue:219-220, two orderedrename_keyops; the test fixture carriesstage_parallelism_cap: 8). Migrating a project that declared the podman-era cap of 8 therefore turns a silently-dropped key into an enforced 8 — which, against a daemon at 4, is the refusal above. (The general form — whether a retired key should fail validation rather than be dropped — isopencharly/spec#241, deliberately not folded in here.)What the org does today, and what this session is changing. The org's builds run at 4 (the sdk's conservative fallback, and the value the live daemon carries). The two manifests that still spelled the knob the retired way —
opencharly/charly :: charly.ymlandopencharly/opencharly :: charly.yml— are being renamed to the landed vocabulary at 4, so the rename is behaviour-neutral and the effective value does not move; "may this host run above 4?" stays the operator decision this thread is about.Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (analysed on a live system)
fix(config): adopt the landed stage_parallelism vocabulary in the pro…