Repository navigation
fix(exec): cloud-init settling in its error state is terminal but NOT ready (#209) - #219
Conversation
… ready WaitForCloudInit treated every settled cloud-init status as success. pollCloudInitSettled is right to call `error` terminal - a guest that errored never becomes `done`, so polling on would reproduce the measured 30-minute hang this file's unprivileged-read design exists to avoid - but terminal is not the same as successful, and the wait returned nil for both: status: done -> settled, ready status: disabled -> settled, ready (prebuilt containerDisk, cloud-init never ran) status: error -> settled ... and reported to every caller as READY That is the root of the chain this row heads: a failed provisioning phase is indistinguishable from a ready guest, so the failure surfaces later as something that looks unrelated (#209, with last_update: Thu, 01 Jan 1970 00:00:43 +0000 in the same report as corroboration). Adds ErrCloudInitFailed and a PURE cloudInitSettledError(out) helper - extracted from the poll closure for the same reason pollCloudInitSettled was, so "terminal is not successful" is directly unit-testable - and the closure now returns it, carrying the guest's own words. The predicate is deliberately UNCHANGED: keeping `error` terminal is what preserves the hang-avoidance. Proven by TestCloudInitSettledError (done/disabled -> nil, error -> ErrCloudInitFailed) in the same file as TestCloudInitStatusScript_ReadsUnprivileged, which guards the hang fix. The negative half of R7 (the test failing without the helper's error branch) is the next step, before any PR. Refs #209 Assisted-by: dsh deepseek-v4.1-flash (syntax check only)
…oud-init failure The second half of #209, at the seam the row's chain actually breaks on. WaitForVmSshReady called WaitForCloudInit and discarded the result with `_ =`, documented as "best-effort: silent on timeout (the downstream deploy-add surfaces the real error)". The first clause is fine and stays: a TIMEOUT may be silent. The second is the assumption the row falsifies - a guest whose cloud-init errored looks READY, so nothing downstream has anything to notice, and the failure surfaces later as something that looks unrelated. Now: timeouts stay silent, an observed ErrCloudInitFailed is warned about at Warn level with the domain and the guest's own words, and the function stays best-effort (its callers live outside this repo - candy/plugin-check's bed session among them - so a signature change is its own decision, not this fix). Gate: gofmt clean, GOWORK=off go build ./... rc=0, go test ./exec/ ok 13.301s. Refs #209 Assisted-by: dsh deepseek-v4.1-flash (syntax check only)
Review — BLOCKHead SHA: Change class: code/config — Go library ( Security screen: PASS — no scope mismatch, secrets, exfiltration, guardrail weakening, or self-modifying-security change. (T1–T4 clear.) Comment intake: none — the thread has 0 comments, so there is nothing to re-derive or disposition. Blocks
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
…s headline behaviour Round-1 BLOCK on #219, both findings, both correct: - R1/QUAL: the new cloudInitSettledError doc block was inserted immediately after pollCloudInitSettled's, with no blank line, so Go merged them into one comment group attached to the NEW func and left pollCloudInitSettled undocumented - a comment contradicting the declaration it sat on. Reordered so each doc is directly above its own func. The validator's own note is the missed control: gofmt -l and go vet do not check comment attachment, so the pasted gates could not have caught it. - R10: the PR's headline - an observed cloud-init failure is no longer silent - shipped no coverage, because the gate functions drive ssh and cannot be exercised without a guest. Extracted cloudInitWarning(err) (PURE, the file's own precedent) so the decision is assertable: ErrCloudInitFailed warns, and nil / a timeout / an ssh drop stay silent. Gate, read raw: gofmt -l exec/ empty, go build rc=0, go vet rc=0, go test ./exec/ -run CloudInit ok 0.024s. Refs #209 Assisted-by: dsh deepseek-v4.1-flash (syntax check only)
Review — BLOCKHead SHA: Change class: code/config — Go library ( Comment intake — 1 comment (github-actions[bot] BLOCK @
Blocks
Everything else re-derives clean: the R10 gap is closed ( Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
…hat hid this twice Round-2 BLOCK on #219, finding 1, and it is my own over-correction: the round-1 fix moved the doc blocks but left a blank line between cloudInitSettledError's doc and its own func, so the doc was detached instead of merged. Same defect, new form, and - as the validator said the first time - gofmt and go vet do not check comment attachment. Fixed, and then GATED, because two review rounds on one file is one round too many to rely on reading: exec/docattach_test.go TestNoDetachedDocComments It flags a // block separated from the func below it by a blank line - the class this review found twice - and deliberately does NOT require every func to carry a doc (unexported helpers and tests commonly do not, and a rule that flagged them would be noise). The new control immediately failed, on SIX pre-existing instances in this package: deploy_executor_live.go (x2), deploy_executor_nested_test.go, executor_threading_test.go, venue_descriptor_test.go. Those are not introduced by this change - but R1 is explicit that a finding is BLOCKING when (quote) 'this change's gate is red or warns because of it', and the gate I just added was red. So they are fixed here too: six stray blank lines deleted, no prose changed. Gate, read raw: gofmt -l exec/ empty · GOWORK=off go build ./... rc=0 · go test ./exec/ -run NoDetachedDocComments ok · go test ./exec/ ok 13.380s. Refs #209 Assisted-by: dsh deepseek-v4.1-flash (syntax check only)
A python scratch file used while writing TestNoDetachedDocComments was added by the previous commit's `git add -A`. The Go test is the control and the only one that belongs in the repo - two mechanisms for one rule is the duplication R2 forbids. Assisted-by: dsh deepseek-v4.1-flash (syntax check only)
Review — PASSHead SHA: Change class: code/config — Go library ( Security screen: PASS — no scope mismatch, secrets, exfiltration, guardrail weakening, or self-modifying-security change. The new Comment intake — 2 comments (both
No surviving finding; the change is a legitimate fix with coverage that fails without it, and no duplication / workaround / legacy path / security issue remains. Checklist: All applicable rules PASS or NA. Non-blocking note (R1 body-accuracy, not a rulebook accounting defect): the Round-2 section says the new control failed on "SIX pre-existing instances" but lists Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
charly task sync: 14 gitlinks advanced (action-review, dotgithub, layer-charly-internals, layer-charly-internals-extra, marketplace, plugin-build, plugin-deploy-vm, plugin-doctor, plugin-fleet, plugin-kubevirt, plugin-substrate, plugin-vm, sdk, spec). This is the consumer leg of the producer-first sequence: the producers landed and tagged first, and the umbrella records them here. How tested: charly task verify. NOTE, filed rather than hidden: the sync step itself exits 1 on a clean, fully-initialized umbrella — it reports "bumped 422 submodule pin(s)" and then [fail]s, while staging exactly the 14 real drift entries. Two explanations were tested and refuted (a merge artefact; uninitialized submodules); the mechanism is not established and the finding is filed with both runs. Refs opencharly/spec#219, opencharly/marketplace#454 Assisted-by: dsh deepseek-v4.1-flash (analysed on a live system)
Summary
The root fix for a failure chain that reaches three repositories.
WaitForCloudInittreated every settled cloud-init status as success:erroris terminal — a guest that errored never becomesdone, so polling on would reproduce the measured 30-minute hang this file's unprivileged-read design exists to avoid — but terminal is not successful, and the wait returnednilfor both. So a guest whose provisioning FAILED was indistinguishable from a ready one, andvenue_wait.gothen discarded even that result:The first clause is fine and stays — a timeout may be silent. The second is the assumption this row falsifies: a guest that looks ready gives downstream nothing to notice, which is why the breakage surfaced later as unrelated symptoms (
opencharly/vm-k3s-server#9, and thecharlyrows), withlast_update: Thu, 01 Jan 1970 00:00:43 +0000in the same report as corroboration.Two commits, both small:
558ef68—ErrCloudInitFailed, plus a purecloudInitSettledError(out)extracted from the poll closure for the same reasonpollCloudInitSettledwas (so "terminal is not successful" is directly unit-testable), and the closure returns it carrying the guest's own words;f15ca16— the seam stops swallowing an observed failure: timeouts stay silent,ErrCloudInitFailedis warned about with the domain and the guest's output. The function stays best-effort by design — its callers live outside this repo (candy/plugin-check's bed session among them), so a signature change is its own decision rather than a stowaway in this fix.The predicate is deliberately unchanged, and stating that is part of the fix: a first reading of this row said "the predicate must not accept
status: erroras settled", and the source says why that would be wrong.How tested
R7 both ways, with the negative half produced by neutering the new branch and restoring from git:
And the module gate
spec/AGENTS.mdnames, on the committed tree:TestCloudInitSettledErrorlands inexec/ssh_wait_cloudinit_test.go— besideTestCloudInitStatusScript_ReadsUnprivileged, which guards the very hang fix this change must not break. That is deliberate: the test most likely to be affected by this change is the one next to it.Round 1 — both findings, fixed
R1/QUAL — a doc comment on the wrong function. The new
cloudInitSettledErrordoc block was inserted immediately afterpollCloudInitSettled's, with no blank line, so Go merged them into one comment group attached to the new func — leavingpollCloudInitSettledundocumented and a comment contradicting the declaration it sat on. Reordered so each doc is directly above its ownfunc. The validator's note is the missed control and I am keeping it verbatim:gofmt -landgo vet ./...do not check comment attachment, so the gates I pasted could not have caught it. This is the same defect I fixed inplugin-doctor#14's round 2 — same shape, same cause (an inserted block landing flush against the previous comment), three repos later.R10 — the headline behaviour shipped no coverage. The seam's new branch could not be exercised without a guest, because
WaitForVmSshReadyconstructs its own executor. ExtractedcloudInitWarning(err) (string, bool)— PURE, following the file's own precedent (pollCloudInitSettled,cloudInitSettledError) — so the decision is assertable:Ordering note, because the rulebook is explicit about it and I did it backwards: a new commit for real fixes is correct, but "write the whole body for the new head, and push" means the body goes first. I pushed
081a3d5and am finalizing the body immediately after; the run it triggered is reading this, and if that costs a round, it is a round I earned.Round 2 — my over-correction, and the control that stops it recurring
R1/QUAL, and the validator's phrasing is the important part: "the underlying defect reproduces in a new form." Round 1 merged the two doc blocks; my fix separated them but left a blank line between
cloudInitSettledError's doc and its ownfunc, so the doc was detached rather than merged. Same class, opposite direction — andgofmt/go vetwere silent again, exactly as the validator had already said they would be.So this round adds the missing control rather than another careful edit:
And the new control immediately failed on SIX pre-existing instances in this package —
deploy_executor_live.go(×2),deploy_executor_nested_test.go,executor_threading_test.go,venue_descriptor_test.go. They are not introduced by this change, but R1 is explicit that this change's gate being red makes a finding blocking, so they are fixed here: six stray blank lines deleted, no prose changed. That is why this round's diff touches four files beyond the helper.This is the second time this exact defect has cost a review round on my work —
plugin-doctor#14was the first — and the difference now is that it has a gate rather than a note. A lesson that does not travel is a lesson half-learned; a test is how it travels.Rulebook compliance
/charly-internals:goand/charly-internals:plugin, both held, plus/charly-internals:git-workflow.status: errormust stay terminal).ErrCloudInitFailedis the single sentinel for this state.spec/AGENTS.md's own gates pasted.spec/AGENTS.md: "the merge gate is the org-widecharly/pr-validator"); the module's own suite is the class gate and it is pasted above.vm-k3s-server#9and thecharlyrows remain theirs.Change classification
Library + seam change in
spec/exec, gated by the module's own suite (GOWORK=off, perspec/AGENTS.md) with both halves of R7 pasted. Root of the chain:opencharly/spec#209.Agent:
dsh-opencharlyAssisted-by: dsh deepseek-v4.1-flash (fully tested and validated)