Repository navigation
release-verify: health-wait gate before moving current on upgrade - #4406
pithead-developer[bot] wants to merge 11 commits into
Conversation
#4393) `docker compose up -d` returns as soon as containers are started, not when they pass healthchecks. A bad image may start but crash-loop; without this gate the upgrade moves `current ->` past the old dir and leaves the operator with no rollback directory. Add wait_services_healthy() that polls docker inspect for State.Health.Status of every enabled service (dashboard, p2pool, tor always; monerod/tari/ wallet-rpc/tari-wallet when their profile is active). Per-service timeout is 120s, covering tor's 90s start_period with margin. Any service not healthy at timeout aborts the upgrade before update_current_symlink fires. Add a test that stubs wait_services_healthy to return 1 and verifies that update_current_symlink and provision_control_runner are never called. Co-Authored-By: Claude Code <noreply@anthropic.com>
|
FAIL What I investigatedThe PR description does not match the required three-section format. Reviewed head: What are the gaps
|
…own start_period The committed 120s uniform timeout aborted every upgrade that restarted tor, whose healthcheck start_period is 600s for cold bootstrap: health reports "starting" for minutes on a normal upgrade, so the gate turned the issue's false-failure criterion into a false abort. wait_services_healthy now reads each container's own Config.Healthcheck.StartPeriod and waits that plus a 60s margin (floor 120s), gates exactly the services the issue names (dashboard, p2pool, tor), and treats an exited/created container as an unhealthy wait whose timeout names it. The #4393 tests move to a new registered fragment, tests/stack, so test-control-upgrade.sh stays at its recorded ceiling; the black-box abort test's verify marker is fixed (the stub never echoed it). Co-Authored-By: Claude Code <noreply@anthropic.com>
|
FAIL What I investigatedThe PR description does not match the required three-section format. Reviewed head: What are the gaps
|
The Shell lint gate's shfmt 3.13.1 reformatted the new fragment and the health-gate case; file-budget counts the merged tree, where develop sits at run.sh's recorded 402 ceiling, so the fragment registers with a bare line and a spare header separator pays for it, matching how #4486 registered test-dashboard-host-prompt.sh. Co-Authored-By: Claude Code <noreply@anthropic.com>
|
FAIL What I investigatedI reviewed PR #4406 at head b781143 against issue #4393. The new gate polls health before
Reviewed head: What are the gaps
|
|
FAIL What I investigatedI reviewed PR #4406 from b781143 to fff4467 against #4393. The upgrade must wait for enabled dashboard, P2Pool, and Tor services within a bound that accommodates Tor’s cold bootstrap, leave
Reviewed head: What are the gaps
Models: gpt-6.2-sol (reviewer); gpt-6.2-sol x3 (angles) |
…ious release through its own CLI on any post-start failure Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ree attempts (#4393) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…say when there is no previous release to restore Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…a p2pool the dashboard holds stopped, take the final read at the bound Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Blocked on #4674 for the fresh tier4-e2e proof this review round asks for. Head f715a8e has the fixes for F4406-2 and 6 to 14 and passes the local stack suites, but |
What's the problem
Part of #4393
pithead upgraderepointedcurrent ->as soon asdocker compose up -dreturned, so an image whose healthcheck never goes green became the live release: the oldcurrent ->rollback copy was already spent, and nothing named the sick service. A uniform-timeout gate would be no better — tor's healthcheck start period is 600s for a cold bootstrap, so a 120s bound would abort every ordinary upgrade that restarts tor, the exact false failure the issue forbids.How I fixed it
stack_upgradecallswait_services_healthyafter the compose-up/caddy leg and only thenupdate_current_symlinkand the control-runner provisioning. The gate polls dashboard, p2pool and tor together, readingState.StatusandHealth.Statusof each, and passes only when all three read healthy in the same pass (a service that went unhealthy while another was still starting is not promoted on its earlier read; an exited container with a leftoverhealthyis not healthy). A p2pool the dashboard deliberately holds stopped until the chains sync (#35) counts as held, aspithead statusalready reads it; a restarting p2pool does not. The poll at the bound is a fresh read before the abort. Each service's bound is sized on that container's own healthcheck,StartPeriod + Interval×Retries + 60sfloored at 120s (tor's 600s cold bootstrap gives 810s), and counted in real elapsed seconds as well as polls. A failedcompose ps, an empty container ID or a failedinspectisunknown: it is retried inside the bound and then aborts naming the service, never promotes.On a gate timeout, a failed
compose up(Compose can replace Tor and then refuse its dependents), or a failed caddy restart after the onion capture,restore_previous_stackresolves the physical directorycurrent ->points at, requires it to be apithead-vX.Y.Zdirectory directly under the same deploy root with an executablepithead, and runs that release's own./pithead upfrom it with the candidate's exportedSTACK_VERSION, version/git provenance and restart overrides unset andPITHEAD_PULL=never. The previous release therefore reapplies its own Tor-only egress rules and image tags, starts its dashboard on its own spool, and the control-runner units (repointed only after the gate) still watch that spool. With nocurrent ->beside the new dir the upgrade says there is nothing to restore. The one-click recovery text,docs/dashboard.mdand the integration docs state this.The #4209/#4324 purpose-circuit probe made one 30s fetch per purpose and failed the row on a single
ConnectTimeoutright after a Tor restart (jobs 4834 vs 4835 on the same head). It now retries up to three attempts with fresh purpose identities when a purpose gets no answer, as it already did for an exit collision.Tests: the fragment
tests/stack/control/test-control-upgrade-health-gate.shpins the unknown-probe paths, the healthy-then-unhealthy dashboard, the bound formula, the real-seconds bound, the failing-compose upand failing-caddy recovery, the restore's path validation (alias chain, outside the root, non-versioned, nocurrent) and the exact env and arguments the previous CLI is started with;tests/stack/lib.sh's docker stub answerscompose ps/inspectas healthy so the real-CLI upgrade tests pass the gate;selftest-purpose-circuits.shdrives the real probe against a stubbed fetch.Shortcut: a failed rollback is reported with the exact
cd <previous dir> && ./pithead uprecovery command, not retried; upgrade it when a second restore attempt proves necessary. Shortcut: thedockerprobes carry no per-call timeout, as nothing else in the CLI does; upgrade when a wedged daemon is seen to hang an upgrade. A failure inprovision_node_onionsormigrate_dashboard_databefore the maincompose upis not routed through the restore.Here is the proof
03-release-verify.shrestored, 23 of the 31 rows oftests/stack/control/test-control-upgrade-health-gate.sh(and 3 of the new probe rows inselftest-purpose-circuits.sh) fail; at this head all pass:source tests/stack/lib.sh; source tests/stack/control/test-control-upgrade-health-gate.shgives PASS=31 FAIL=0,bash tests/integration/selftest/selftest-purpose-circuits.shpasses every row, andtest-control-upgrade.shgives PASS=146 FAIL=0.tests/stack/run.shblocks 1 to 5 at headf715a8ea: 2814, 2018, 300, 281 and 3612 rows pass. The only reds are environmental on this host: the Go module raise watch self-test (nogoon PATH, ×2) and "real root/page boundary requires sudo and setpriv" (no passwordless sudo); neither touches this diff.make lint-pithead-build,make lint-file-budget,make lint-topology,make lint-docs-voice, markdownlint on both edited pages,ruff checkandruff format --checkon the probe, shellcheck--severity=warningandshfmt -i 4 -don the touched scripts are clean (this host has shellcheck 0.12.0 and shfmt 3.15.0, not the pins; CI has the pins).e0f0faef: every check passed exceptBuild image (tor), which fails on every branch since Alpine retiredtor=0.4.9.17-r0(tracked as Build image (tor) red: Alpine retired tor=0.4.9.17-r0, the exact-version pin no longer resolves #4674; no tor file is in this diff), and a cancelled macOS soak self-test that was rerun. The runner holds tier4 submits until those pass, so no fresh e2e exists on the current head yet: pending on Build image (tor) red: Alpine retired tor=0.4.9.17-r0, the exact-version pin no longer resolves #4674.compose upand failed caddy restart recover before exit), F4406-10 (physical previous dir validated under the deploy root), F4406-11 and F4406-12 (the previous release's own./pithead upwith the candidate env unset andPITHEAD_PULL=neverreapplies its egress policy and image tags), F4406-2 (the previous dir's stack and spool are restored, the units never moved), F4406-13/14 (docs,is_versioned_install_dir), F4406-6 (probe retry, three attempts).fff4467a, before this round's rollback and probe changes (to be re-run on the current head): attempt 1 — job4834@fff4467a80e2edb2c798431dc7cfb9a76c88e9a9— completed with ONE functional red row: the dashboard health/notify Tor-circuit probe (Per-purpose SOCKS credentials: each outbound purpose gets its own Tor circuit #4209/Live tier4 proof: dashboard purposes exit different Tor circuits #4324) timed out (notify: fetch failed (ConnectTimeout) health: no answer) inside one 60s window and the dashboard answered the rows immediately before and after; the deploy ranpithead upgradethrough the new health gate cleanly ([pithead] Stack upgraded., no gate warning, no restore leg), the row is green cross-head on the same day (job792@bde388b8a, both phases), and no other failing tier4-e2e job on any head in the recent fleet window carries this row. Attempt 2 —4835@fff4467a80e2edb2c798431dc7cfb9a76c88e9a9(--new-attempt) — completed: the Per-purpose SOCKS credentials: each outbound purpose gets its own Tor circuit #4209 row passed, and the only functional red rows are "after the boot unit, port : a private source can (LAN guard on the *_lan_access ports is not restored at boot: DIY Docker hosts publish them to every source until ./pithead up #2749)" (×2, monerod and tari) — the harness found the lan-guard check unit inactive at the check (ActiveState=inactive,SubState=dead, readinessclosedafter 244s,node_listener=unavailable). That is tracked as e2e hardening: "after the boot unit ... a private source can (#2749)" fails with the lan-guard unit inactive #4641, which records the identical two-row failure on unrelated heads (jobs1126@ee84bd3c0,1124@5cc985115) and says every hardening-phase run goes red on them — so a resubmit cannot clear it before e2e hardening: "after the boot unit ... a private source can (#2749)" fails with the lan-guard unit inactive #4641 does; the same rows passed cross-head on the same day (792@bde388b8a), and the bench had no downtime interval in the run window. Both attempts ran the branch deploy through the new health gate cleanly (both[pithead] Stack upgraded.legs, no gate warning, no restore) — 325 targeted-suite rows passed. Blocks, unedited — attempt 1 then attempt 2:Ponytail verdict: the smallest gate that satisfies the issue — one wait helper, one restore helper, one call site, no compose-profile parsing, timeouts read from the containers instead of configured.
🤖 Generated with Claude Code