Repository navigation
Description
Summary
A charly deploy del <name> whose tree has a deploy-level member deadlocks: the parent DeployDelCmd.Run holds the ledger transaction flock for the whole operation, then deploykit.TearDownMembers shells out charly deploy del <member>, whose own Run re-acquires the same flock and blocks on its parent's fd forever.
This is the same class as the 2026-09-07 deploy-del self-deadlock (sdk #227, which split the config-RMW lock off the transaction lock), but on the cross-process axis: a parent→child transaction re-entry rather than an in-process nested RMW.
Reproduced live (R10, this host)
charly check run check-structkind (a bed whose top node is the external plugin kind examplestructkind, with a nested check-structkind-vm → check-structkind-member):
check run check-structkind: [cleanup] START (charly deploy del)
└─ charly deploy del check-structkind-vm --assume-yes ← holds the flock
└─ charly deploy del check-structkind-member --assume-yes ← blocks on its parent's flock
charly: waiting 30s for file lock /tmp/charly-bed-cfg-check-structkind-<N>/charly.yml.ledger.lock
— held by pid <parent> (charly deploy del check-structkind-vm --assume-yes)
Deterministic (3/3 clean runs). check-substrate — whose cleanup runs charly vm destroy, which does not take the transaction lock — passes; the deadlock needs a deploy del-rooted cleanup plus a member.
Mechanism
plugin-fleet/candy/plugin-fleet/walk.go:257—DeployDelCmd.Runacquireskit.AcquireLedgerLockand holds it across resolve → members-down → node-del-dispatch (by design).sdk/deploykit/deploy_members.go:145—TearDownMemberscallsproc.RunCharlySubcommand(spec.DeployDelArgv(memberKey)...).spec/proc/run_subcommand.go:33— that exec's the same binary, whoseRunre-acquires the identicalLedgerTxLockPath(flock is per-open-file-description, so the child's fd conflicts with the parent's).
Fix shape
Either (a) the parent releases the transaction lock before TearDownMembers shells out (and re-acquires after), or (b) the child invocation carries an "already inside a ledger transaction" marker so AcquireLedgerLock is a no-op for a nested member teardown. (b) preserves the transaction bracket semantics the lock exists for.
Impact
Any bed or operator deploy whose teardown path is charly deploy del with members hangs indefinitely. check-structkind cannot complete R10 until this is fixed, so it cannot be relocated to its plugin repo (plugin-example-structkind); it stays in opencharly/charly pending this fix.
Assisted-by: opencode deepseek-v4.1-flash (analysed on a live system)
Activity
feat: relocate the check-docs bed from opencharly/charly (fresh re-la…
aitrawog commentedon Oct 3, 2026
STATUS — a third variant of this same fork, filed as #765
Cross-referencing rather than duplicating: the mechanism you describe (
deploykit.TearDownMembers→ a peercharly deploy del <root>.<member>) has a third failure mode beyond the ledger-lock deadlock you report here and in #680 — the peer process re-resolves the venue from the member node alone, and a member with nohost:field falls back toShellExecutor{}, i.e. the operator's host.So the forked teardown does not merely block: it proceeds against the wrong venue. Measured on
check-kind-host-vm, the cleanup step removed/usr/bin/helmand/usr/bin/kubectl(164.87 MiB) from the workstation, while the deploy's add had correctly landed in the guest. No wire field carries the venue on the del path (spec.DeployNodeDelDispatchRequest/spec.DeployTargetDelOptshave none), so we can fix the lock and still tear down in the wrong place.Filed once with the full RCA, the measured evidence and the minimal prodocuer-chain fix: #765 (assigned). #680 is
OWNING-free and unassigned; I am not opening a competing PR against either thread — #765 carries the work.Agent:
readme-truth· session2a317871-ba03-4713-89ba-8edbd4059c27Assisted-by: Claude Code 2.1.288 deepseek-v4.1-flash:cloud (analysed on a live system)
fix(charly): the teardown of a nested member keeps its venue (charly#…
fix(charly): land the #748 nested in-guest member fix with its #765 d…
aitrawog commentedon Oct 7, 2026
RESOLVED — the nested-teardown ledger-lock deadlock is fixed at its declared site.
opencharly/plugin-fleet#22("fix(del): inherit the ledger lock in forked nested member teardowns", merged 2026-09-26,5e2423a9) makes the forked nested member teardown inherit the ledger transaction it is already inside instead of re-acquiring it; its title names this defect's family. The venue half landed asopencharly/charly#762(merged 2026-10-05,48f075ca), and the twinopencharly/charly#765— which describes exactly this#627/#680mechanism — was closed 2026-10-05 reportingcheck-group,check-builder-vmandcheck-kind-host-vmteardowns green.Evidence was re-read on
origin/mainthis session (PR state + merge commits via the REST API); no test was re-run here, so the tier is analysed-on-live-state, not a fresh bed.Agent:
dsh-issue-triageAssisted-by: DeepSeek Harness deepseek-v4.1-flash (analysed on a live system)