Skip to content

flaky: tier4-kvm provision control-regressions leg cascades from an intermittent out_peers CONFIRM misclassification #2374

Open

Description

@pithead-developer

What's the problem

Seen twice on unrelated bench-ci tier4-kvm (phases:["provision"]) runs, both from #2270's branch but on commits with no code difference from develop in the relevant area, so this is not caused by that branch's diff:

  • job 489, commit with an (unrelated, since-reverted) reorder in lib/pithead/43-control-approval-and-preview.sh.
  • job 522, commit 6711da6b where lib/pithead/43-control-approval-and-preview.sh is byte-identical to develop.

Both times the battery scores 59 passed / 11 failed with the identical first failure and cascade shape, vs. 91 passed / 1 failed (only the pre-existing #2333 gap) on other runs of effectively the same code (jobs 93, 501, 513) — so this looks like an intermittent (~50%) flake, not a deterministic regression.

First failure both times: post-provision disruptive setting was not classified CONFIRM (tests/os/provision-browser-submit.sh, phase_provision_control_regressions, the monero.out_peers disruptive-preview check). From there the run cascades into: control-runner recovery: guest .env is not DEPLOYMENT_COMPLETED=true before the fault — leg cannot run, onion exposure: ./pithead apply -y did not accept the onion-enabled config (+ cleanup), day-two hostname preview mutated identity or missed its approval gate (recurrence of the #2223 symptom, closed by #2236), sensitive appliance regression phase aborted before completing required checks, the built-in miner never came up, monerod container never came up, tari.mode off: the commit never returned a terminal result, unaided reboot identity did not converge, A/B update identity did not converge (recurrence of the #2223/#2060-shaped symptom).

This shape — one classification miss immediately after a benign commit, then a wide cascade through unrelated legs — suggests either a real race in how quickly the control runner in the guest picks up a preview request right after a prior commit, or bench/KVM timing variance under load. Filed rather than root-caused: diagnosing guest-side control-runner timing is out of scope for pithead#2270's branch, which only adds a stack-level shell test and does not touch this code path.

Job log excerpts (redacted): bench-ci jobs 489, 522, first-failure lines ~1062 and ~1063 respectively.

what it impacts

Impact is not separately established in the existing report; confirm the affected users or behavior.

How I found it

Discovery details are not separately established in the existing report; preserve and verify the evidence already recorded.

how important is it

Importance has not been assessed explicitly; triage must state the priority and its reason.

acceptance criteria

Acceptance is not isolated in the existing report; the agent must identify a testable outcome before implementation.

possible solutions

No distinct solution options are recorded; investigate the existing report before choosing an approach.

Activity

  1. added
    flaky
    on Sep 19, 2026
  2. added this to the v2 - appliance milestone on Sep 19, 2026
  3. pithead-developer commented on Sep 19, 2026

    @pithead-developer
    ContributorAuthor

    Questions before work continues (answer here, then remove the question label):

    The worker stopped without a result (error, success). Branch agent/2374-flaky-tier4-kvm-provision-control-regres holds what it had. Raise the cap, split the issue, or take it over.

  4. added
    question
    on Sep 19, 2026
  5. pithead-architect commented on Sep 19, 2026

    @pithead-architect

    Ruling: Neither cap, split nor takeover. No worker ran: the Claude plan refused the session at 06:31Z with "You've hit your session limit · resets 2:10am (America/Chicago)", one turn, zero tokens, 0.00 USD, and the branch is untouched. Pick the issue up as freshly handed. Start from jobs 489 and 522 against 93, 501 and 513: find what differs at the moment provision-browser-submit.sh asks for the out_peers preview right after the prior commit. If the control runner in the guest can answer a preview from stale state, that is the product bug and the fix goes there; if the classification is right and the harness reads it too early, the fix is in the phase. Either way the cascade is the harness's: the phase must not turn one miss into ten unrelated reds, so the legs that follow record their own result. Evidence is one tier4-kvm provision job on the head, conclusion quoted, and if the ~50% flake makes one run inconclusive say so and quote both. Take your defaults, list them under "Decisions taken", and return only for a product decision.

  6. removed
    question
    on Sep 19, 2026
  7. pithead-developer commented on Sep 19, 2026

    @pithead-developer
    ContributorAuthor

    Review returned: the operator's call (rule here, then remove the review-returned label):

    Review of PR #2431 did not pass after round 2 (RETURN).

    The fix is sound, lean, root-cause-adjacent, and its new self-test provably fails without the production hunk — I reverted that hunk in a scratch worktree and watched it go red. But the single artifact the architect's ruling made mandatory, a completed tier4-kvm provision job on the head with its conclusion quoted, still does not exist: bench-ci job 606 (ci-4 #83) is queued at 3beb7af, and the head has since moved to merge commit 25a8e56. That merge pulled in #2418's rewrite of tests/os/run.sh pass/skip accounting, so job 606 will not cover the head even when it drains — a fresh tier4-kvm submission at the current head is required. This is queue contention, not a bench-ci fault; do not file a bench-ci issue.

    • [return] bench-ci job 606 (bench ci-4, per-bench id 83); PR fix(os): de-cascade the control-runner recovery leg from a settling precondition #2431 'Test plan' unchecked tier4-kvm item: The diff changes tests/os/, the tier4-kvm harness itself, so per the protocol and the architect's explicit ruling the PR needs a completed tier4-kvm provision job on the head with its conclusion quoted. bench-ci status 606 returns status=queued, conclusion=null, queue_position=10 at commit 3beb7af. No completed tier4-kvm run exists for this branch at any commit. The self-test drives a fully mocked _ssh/dashboard_curl and cannot show the poll converges against a real guest with a real slow-draining control-runner spool, which is the entire behaviour under test. This is a missing artifact, not a code defect — no source change is required to clear it.
    • [return] PR head 25a8e56 vs job 606's commit 3beb7af: Even when job 606 drains it will not cover the head. git diff --stat 3beb7af4 25a8e56e shows the merge brought in fix(os): count an all-skipped tests/os run as no-run, never a pass #2418's changes to tests/os/run.sh (+62/-21), the new tests/os/selftest-skip-accounting.sh, and tests/os/phases/crossupdate.sh — that is the tier4-kvm runner's own pass/skip/no-run scoring, not docs. A job on the older commit tests a different scorer. Resubmit tier4-kvm phases:[provision] at the current head and quote that job's conclusion; cancelling 606 to free queue position is the worker's call.
    • [note] PR fix(os): de-cascade the control-runner recovery leg from a settling precondition #2431 title; tests/os/control-runner-recovery-leg.sh:31-44: The title claims the PR stops the provision phase from cascading an out_peers preview miss, but the diff does not touch the out_peers miss and de-cascades exactly one of the nine cascaded legs issue flaky: tier4-kvm provision control-regressions leg cascades from an intermittent out_peers CONFIRM misclassification #2374 enumerates. The ruling asked that the legs that follow record their own result, plural. The narrowing is disclosed under 'Decisions taken', which is why this is not a second return, but the 'genuine downstream symptoms' defence is weak for 'onion exposure: ./pithead apply -y did not accept the onion-enabled config' and 'day-two hostname preview mutated identity or missed its approval gate', which have their own setup and their own approval gate rather than depending on this leg's precondition. Either narrow the title to what the diff does or extend the isolation to those legs.
    • [note] PR fix(os): de-cascade the control-runner recovery leg from a settling precondition #2431 'Test plan' section: The architect's ruling anticipated that a ~50% flake makes a single run inconclusive and required both runs quoted in that case. The test plan provisions for one tier4-kvm job. A single green provision run does not distinguish a fixed leg from a lucky one at that flake rate — plan for two, or state explicitly why one suffices.
    • [note] PR fix(os): de-cascade the control-runner recovery leg from a settling precondition #2431 body, 'Fix:' paragraph; tests/os/control-runner-recovery-leg.sh:37-43: The body says the poll matches 'this file's own deadline=$(($(date +%s) + N)) bounded-wait style used twice later in the same function'. It does not — the new code uses a try-counter (pretries tested against -lt 10), a different mechanism. The counter is the leaner form and needs no change, but the sentence is false. Relatedly, 10 tries with 9 intervening sleep 3 calls is ~27s of waiting, not the 'up to 30s' the body states.
  8. pithead-architect commented on Sep 19, 2026

    @pithead-architect

    Ruling: Both returns hold and there is no bench-ci issue to file; this is queue wait. In order: (1) cancel job 606, it tests a scorer the head no longer has; (2) narrow the title and the body to what the diff does, one leg de-cascaded, and fix the false sentence about the deadline style, the try-counter is fine, the description of it is not; (3) submit two tier4-kvm phases:[provision] jobs at the current head 25a8e56, a ~50% flake makes one green run indistinguishable from luck, and return waiting with both in bench_jobs; (4) quote both conclusions in the body when they complete, with the control-runner recovery leg's own row named in each. The other eight cascaded legs stay on #2374 as follow-up rows named in the body, not in this PR: the onion-exposure and day-two-hostname legs the reviewer singles out get their own isolation only if the two runs show them still cascading with this fix in place, and then as a scoped commit on this branch, not a second issue.

  9. pithead-developer commented on Sep 20, 2026

    @pithead-developer
    ContributorAuthor

    Review returned: the operator's call (rule here, then remove the review-returned label):

    Review of PR #2431 did not pass after round 3 (RETURN).

    The 46-line diff is sound and I could not find a defect in it: the new self-test provably fails without the production hunk, tiers 1-3 are green at the head, lints and topology are clean, and there is nothing to cut. It is returned on evidence, not code. The two ordered tier4-kvm jobs ran at 25a8e56 while the head is b36715b, and the intervening develop merge added a second dashboard submit directly ahead of this leg's call site — the exact settling-predecessor condition under test. More decisively, the race never fired in any of the three runs (~1.5s fast path against the ~242s stall in the failing jobs), so none of them demonstrates the fix, and because the poll logs nothing when it retries, no future run can either until an info line is added.

    • [return] bench-ci jobs 648 and 649 (commit 25a8e56) vs PR head b36715b: The two ordered tier4-kvm jobs do not cover the head. bench-ci status 648/649 both report commit 25a8e56; the head has since moved to the pithead-reviewer[bot] develop merge b36715b. The intervening commits are not docs: git diff 25a8e56e..HEAD shows tests/os/phases/provision.sh gains a whole new _phase_provision_power_cut phase, and tests/os/phases/provision-initial.sh gains a second provision_node_preflight submit inside _phase_provision_initial_body, ahead of line 195 where phase_provision_control_recovery is called. This PR's premise is that a sibling leg's control request can still be settling on the guest, so adding another dashboard submit to this leg's run-up changes exactly the condition under test. Resubmit two tier4-kvm phases:["provision"] jobs at b36715b.
    • [return] bench-ci logs for jobs 606, 648, 649 — the post-provision benign setting applies / post-provision disruptive setting previews rows: The race did not fire in any of the three runs, so none of them demonstrates the fix. Re-derived from the logs: 648 benign apply 22:06:23.019Z -> disruptive preview 22:06:24.868Z (1.85s); 649 22:33:41.118Z -> 22:33:42.661Z (1.54s); 606 1.5s per the body. Against the ~242s stall the body itself identifies in failing jobs 489/522. All three runs are 91 passed, 1 failed, skipped: 0/0/0 — the same shape jobs 93/501/513 produced with no fix at all. The architect required two runs because one green run is indistinguishable from luck at a ~50% flake rate; two runs in which the race never occurred are indistinguishable for the same reason. The body correctly makes this concession for 606 and has not extended it to 648/649.
    • [return] tests/os/control-runner-recovery-leg.sh:37-44: The poll emits nothing when it retries, so no bench run can ever show it engaged. A run where the precondition read true on the first _ssh and a run where it read false for 24s then converged produce byte-identical output: the same two green rows. That makes the artifact the ruling requires — 'quote both conclusions, with the control-runner recovery leg's own row named in each' — unable to distinguish a fix that worked from a flake that did not fire, which is why the existing runs cannot be signed off and the next two could not be either. One info line inside the loop when pretries is non-zero, naming how long it waited, is enough; info is already a harness primitive (it is in selftest-run-modules.sh's expected_functions list). Add it before resubmitting.
    • [note] PR fix(os): de-cascade the control-runner recovery leg from a settling precondition #2431 body, 'Evidence' section: The body still lists jobs 648 and 649 as 'queued' and promises 'Both conclusions get quoted here on completion.' Both completed before the body's last edit — 648 at 2026-09-19T22:36:41Z, 649 at 23:03:38Z, against a body last updated 2026-09-20T04:11Z. A reader of the public thread is told pending work that is done.
    • [note] bench-ci jobs 648/649 conclusion field; issue Bench fixture: non-blank PITHEAD_OS_MONERO_NODE_PASSWORD makes the reserved-node preview row unpassable #2333: Recorded so the next pass does not return on it: conclusion: failure on both jobs is entirely the known Bench fixture: non-blank PITHEAD_OS_MONERO_NODE_PASSWORD makes the reserved-node preview row unpassable #2333 bench-fixture gap, not a defect of this branch. In both logs the single red is reserved-node preview did not expose endpoints behind the combined approval gate, rejected on MONERO_NODE_PASSWORD; issue Bench fixture: non-blank PITHEAD_OS_MONERO_NODE_PASSWORD makes the reserved-node preview row unpassable #2333 is OPEN and titled 'Bench fixture: non-blank PITHEAD_OS_MONERO_NODE_PASSWORD makes the reserved-node preview row unpassable'. conclusion: success is unreachable for any tier4-kvm phases:["provision"] job until Bench fixture: non-blank PITHEAD_OS_MONERO_NODE_PASSWORD makes the reserved-node preview row unpassable #2333 lands — judge these runs on the 91 passed, 1 failed line and the named rows, not the conclusion field.
    • [note] tests/os/control-runner-recovery-leg.sh:37-44 (over-engineering pass): Nothing to cut. A 7-line bounded retry is the floor in bash, and no general-purpose wait helper is being reimplemented: the _wait_* functions in tests/os/lib/core.sh are all task-specific (_wait_ssh, _wait_new_boot, _wait_dhcp_ip, _wait_setup_page). The try-counter rather than a date +%s deadline is the right call here and the body now describes it accurately, as the round-2 ruling directed.
  10. pithead-architect commented on Sep 20, 2026

    @pithead-architect

    Ruling: The return stands on all three points, and the bar for the next round is fixed here so there is no fourth. Do this in order: (1) in tests/os/control-runner-recovery-leg.sh, inside the poll loop, emit one info line when pretries is non-zero, naming how long the precondition was waited for, so a run where the poll engaged is distinguishable from one where it did not; (2) show the self-test red then green at the head: revert the production hunk, quote the failing row, restore it, quote the passing row, both in the body under Evidence; (3) then submit two tier4-kvm phases:["provision"] jobs at the head as it stands after (1), record both in bench_jobs, return waiting, and when they complete quote both conclusions with the control-runner recovery leg's own row named in each, and replace the stale "queued" lines for 648 and 649 with their conclusions and the same concession you already made for 606. The evidence that closes this is the red-then-green self-test plus two green provision runs at the head with that row named; the race is not required to fire on demand, and the body says so plainly instead of promising it. If a run does show the info line, quote it as a bonus. The one red row in the phase is #2333's, owned, and does not wait on this PR. Do not merge develop yourself; the runner updates the branch at the merge.

  11. pithead-developer commented on Sep 24, 2026

    @pithead-developer
    ContributorAuthor

    Investigation brief (operator pre-read, 2026-09-23 — reviewed/corrected 2026-09-23)

    Still valid: yes, partially resolved. PR #2431 (merged 2026-09-20, commit ca97f275) fixed exactly 1 of the 9 cascaded legs this issue lists — tests/os/control-runner-recovery-leg.sh (poll loop now at lines ~37-47, one line later than originally cited due to an unrelated later commit touching a different file in the same repo) now polls up to 10×3s instead of reading DEPLOYMENT_COMPLETED once, with an info line when the poll engages. Verified against the live PR body and tier4-kvm jobs 606/648/649/713/714, all quoted in the PR's own Evidence section.

    Root cause: the PR's own Investigation section traces the real stall to the guest-side control-runner spool/systemd path-unit handoff under bench-load contention (lib/pithead/49-control-request-loop.sh, lib/pithead/50-control-runner-provisioning.sh) — the same class #2219 already patched once. dashboard_control_request's 240s deadline (tests/os/provision-browser-submit.sh:117-146) expires before out_peers resolves, and the classification logic itself (describe_change, lib/pithead/39-describe-change.sh) is not at fault. The PR states plainly it does not fix this stall — it only makes the recovery leg's own precondition tolerant of a settling sibling.

    Remaining scope: 8 legs from the original cascade are still unisolated and untouched since the merge — confirmed via the full comment thread (gh issue view 2374): 6 comments total, the last at 2026-09-20T05:17:13Z (the round-4 ruling that preceded the merge), zero since. The round-2 architect ruling was explicit these get isolated as scoped commits on this same issue, "not a second issue," and only if a run shows them still cascading with the current fix in place — the PR's own evidence (jobs 648/649/713/714) showed only the unrelated #2333 fixture red, so no further isolation has actually been triggered yet.

    Duplicates/blockers: #2333 (open, unrelated bench-fixture gap — PITHEAD_OS_MONERO_NODE_PASSWORD non-blank) and #2471 (open)/#2452 (closed, unrelated M10 power-cut flake) both surface as incidental reds in the same tier4-kvm runs but are not blockers for this issue.

    Fix shape: none required right now. If/when a remaining leg shows the same settling-predecessor cascade, apply the same pattern #2431 used (point-in-time read → bounded poll + info line) as a scoped follow-up commit.

    Evidence tier: tier4-kvm, satisfying tier-follows-the-path for the tests/os change that landed (jobs 606/648/649/713/714, all phases:["provision"], quoted in PR #2431). No tier4-kvm evidence exists yet for the 8 remaining legs since no fix has been attempted for them.

    Rulings needed: (1) leave the 8 remaining legs dormant until a run actually shows them cascading, or proactively isolate them now? Default: leave dormant, per the round-2 ruling's own condition. (2) is the underlying spool-drain latency worth a dedicated fix vs. permanent leg-by-leg polling workarounds? Default: workaround stands.

    Triage — corrected: the issue is already on milestone "maintenance & gates" (#22), which is one of the milestones frozen until GA per the release context, and whose own charter — "Never blocks a ship; worked only when the ship queue is empty" — the original brief quoted as justification for a "MOVE-2.0.x" action. There is nothing to move: it was never on the v2/appliance release milestone. Recommendation: KEEP on "maintenance & gates," no milestone change needed. Everything else — root cause, the 1-of-9 fix, the still-dormant 8 legs, and the non-blocking status — holds as written.

    Verify against the code before relying on this; it was written by an investigator, not the implementer.

  12. pithead-developer commented on Oct 19, 2026

    @pithead-developer
    ContributorAuthor

    PR #2431 is merged, and current develop (a10dbf0bdf34d6f77f42acbeadca1387ed392167) retains its bounded recovery-leg precondition poll and retry reporting. No open PR remains for this issue. The September 19 ruling makes further isolation conditional on a run showing the remaining legs still cascading; no new recurrence has been supplied in this thread.

    Leaving the remaining work dormant under that ruling. Resume on a new completed failing/errored Pithead tier4-kvm job containing both exact failed rows:

    • post-provision disruptive setting was not classified CONFIRM
    • onion exposure: ./pithead apply -y did not accept the onion-enabled config

    Both strings were verified in the retained structured failed rows of job 522@6711da6b29b113b8f0ec291968892735527b1a9a. Its raw log now returns HTTP 410 under the retention policy; this is a recurrence signature, not a new root-cause conclusion. The runner can resume this issue on matching evidence so the failed request and downstream leg can be investigated together. No source changes or new test submissions were made in this session.

  13. pithead-developer commented on Oct 23, 2026

    @pithead-developer
    ContributorAuthor

    Parked in Icebox under the lean roadmap (owner, 2026-10-21: flaky tests are rerun, not fixed; harness forensics parked; no soaks): a flaky KVM leg that passes on rerun; the bounded-retry fix is merged. It comes back if it recurs and becomes a hard release blocker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    flaky

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions