updates: "Retry now" always answers the operator with an error — the synchronous retry request is killed by the ADR 0259 self-restart, and the screen never re-reads #1658

Closed
opened 2026-09-20 08:14:01 +00:00 by ben · 2 comments
Owner

The defect (seen live, #1614 run 20260920T070007Z; read off the Playwright trace)

On U4x the operator presses "Retry now". The retry RUNS — the box re-landed C, self-swapped, and (C being unbootable) the guard restored and the release quarantined at attempt 2. But the operator is told it FAILED, and the screen never updates:

07:43:05  POST /api/v1/updates/rollout/updates-c/retry-by-hand  → 502
07:43:08  GET  /api/v1/updates, /api/v1/updates/rollout          → 200   (last reads)
…no /api/v1/updates* request for the next 18 minutes…

Cause: RetryByHand runs the staged rollout synchronously inside the HTTP handler (internal/controlapi/updates.go:~154-158). Since ADR 0259 the gateway stage ENDS by restarting the control plane — the very process serving that request — so for ANY release that carries a control-plane binary the POST dies with the restart (caddy answers 502), whether the retry goes on to succeed or fail. RolledBackScreen.vue onRetry then takes its error branch (if (error.value) return; — no retried emit, no re-read), leaving a stale "attempt 1 of 2 · Retry now" card under an error message. A real operator would press it again.

The rehearsal healer fixed the drive's own reading of this (1ab409f3, harness only). The product behaviour is unchanged.

Fix

  1. retry-by-hand starts the retry and answers at once (202 Accepted); the rollout runs on the orchestrator's own goroutine exactly as a windowed rollout does, checkpointed (#1567) so it survives its own restart. Keep the ADR 0259 rule: refuse with the plain "a deploy is in flight" message rather than start.
  2. On 202 the surface goes to U3 and polls, and U3's polling must ride out the restart (a 502/connection drop during a rollout is "restarting", not an error — U3 already says so on its gateway row, ADR 0259).
  3. Audit the sibling synchronous acts for the same trap — end-early (safe? it does not deploy) and the U2 approve path when the window is already open.
  4. Copy bug on the same card: in the boot-failure path the failure line renders with an EMPTY node name ("'s control plane service failed its health check…") and says "failed its health check" where the truth is "did not start" (bootFailedCheck). RecordBootFailure composes the result with no failing node; name the gateway and use the boot-failure wording.

Acceptance

  • Handler test: retry-by-hand returns 202 before the rollout finishes; a second press while it runs is refused plainly, not queued twice.
  • Surface test: after a 202 the surface is on U3; a 502 on a poll mid-rollout keeps U3 (no error state) and the next good read lands U4/U4x.
  • The boot-failure U4x names the node and says the control plane did not start.
  • GOTCHAS (a synchronous act that crosses a self-restart always reports failure) + STATUS in the same commit.

Live proof rides the #1614 drive's rolled-back leg (it presses this button).

## The defect (seen live, #1614 run `20260920T070007Z`; read off the Playwright trace) On U4x the operator presses **"Retry now"**. The retry RUNS — the box re-landed C, self-swapped, and (C being unbootable) the guard restored and the release quarantined at attempt 2. But the operator is told it FAILED, and the screen never updates: ``` 07:43:05 POST /api/v1/updates/rollout/updates-c/retry-by-hand → 502 07:43:08 GET /api/v1/updates, /api/v1/updates/rollout → 200 (last reads) …no /api/v1/updates* request for the next 18 minutes… ``` Cause: `RetryByHand` runs the staged rollout **synchronously inside the HTTP handler** (`internal/controlapi/updates.go:~154-158`). Since ADR 0259 the gateway stage ENDS by restarting the control plane — the very process serving that request — so for ANY release that carries a control-plane binary the POST dies with the restart (caddy answers 502), whether the retry goes on to succeed or fail. `RolledBackScreen.vue` `onRetry` then takes its error branch (`if (error.value) return;` — no `retried` emit, no re-read), leaving a stale "attempt 1 of 2 · Retry now" card under an error message. A real operator would press it again. The rehearsal healer fixed the drive's own reading of this (`1ab409f3`, harness only). The product behaviour is unchanged. ## Fix 1. `retry-by-hand` **starts** the retry and answers at once (`202 Accepted`); the rollout runs on the orchestrator's own goroutine exactly as a windowed rollout does, checkpointed (#1567) so it survives its own restart. Keep the ADR 0259 rule: refuse with the plain "a deploy is in flight" message rather than start. 2. On `202` the surface goes to U3 and polls, and U3's polling must ride out the restart (a 502/connection drop during a rollout is "restarting", not an error — U3 already says so on its gateway row, ADR 0259). 3. Audit the sibling synchronous acts for the same trap — `end-early` (safe? it does not deploy) and the U2 approve path when the window is already open. 4. Copy bug on the same card: in the boot-failure path the failure line renders with an EMPTY node name ("`'s control plane service failed its health check…`") and says "failed its health check" where the truth is "did not start" (`bootFailedCheck`). `RecordBootFailure` composes the result with no failing node; name the gateway and use the boot-failure wording. ## Acceptance - [ ] Handler test: `retry-by-hand` returns 202 before the rollout finishes; a second press while it runs is refused plainly, not queued twice. - [ ] Surface test: after a 202 the surface is on U3; a 502 on a poll mid-rollout keeps U3 (no error state) and the next good read lands U4/U4x. - [ ] The boot-failure U4x names the node and says the control plane did not start. - [ ] GOTCHAS (a synchronous act that crosses a self-restart always reports failure) + STATUS in the same commit. Live proof rides the #1614 drive's `rolled-back` leg (it presses this button).

swarm-claim host=matou-dev-server-01 run=28236
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=28236 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #1658 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1658,
  "status": "success",
  "commits": [
    "157eba0f"
  ],
  "changed_files": [
    "STATUS.md",
    "dashboard/src/lib/rollout.ts",
    "dashboard/tests/unit/rollback.test.ts",
    "docs/GOTCHAS.md",
    "internal/controlapi/updates.go",
    "internal/controlapi/updates_rollout_integration_test.go",
    "internal/update/bootfailure.go",
    "internal/update/bootfailure_test.go",
    "internal/update/rollback.go",
    "internal/update/rollout.go",
    "internal/update/rolloutview.go",
    "internal/update/store.go",
    "internal/update/update.go",
    "packages/openapi-spec/openapi.yaml"
  ],
  "tests": [
    {
      "command": "go test ./internal/update/... ./internal/controlapi/... ./control-plane/cmd/control-plane/",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/update/... ./internal/controlapi/... ./control-plane/...",
      "exit_code": 0
    },
    {
      "command": "golangci-lint run ./internal/update/...",
      "exit_code": 0
    },
    {
      "command": "npx vitest run (dashboard, 1753 passed)",
      "exit_code": 0
    },
    {
      "command": "npx vue-tsc --noEmit (dashboard)",
      "exit_code": 0
    },
    {
      "command": "node packages/openapi-spec/scripts/generate-client.mjs --check",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Handler test: retry-by-hand returns 202 before the rollout finishes; a second press while it runs is refused plainly, not queued twice": "internal/controlapi/updates_rollout_integration_test.go TestRolloutHandler_RetryByHand_StartsAndRefusesSecondPress — first press 202 while canary blocked (rollout unfinished), second press 409, released retry finishes and quarantines. Backed by Orchestrator.StartRetryByHand (internal/update/rollback.go) claiming synchronously via retryMu/retrying + durable checkpoint.",
    "Surface test: after a 202 the surface is on U3; a 502 on a poll mid-rollout keeps U3 (no error state) and the next good read lands U4/U4x": "dashboard/tests/unit/rollback.test.ts 'after a by-hand retry the surface holds U3 across a restart 502 (#1658)' — retry -> U3, scripted 502 poll keeps rolling-out with no updates-unreachable, next good read lands rolled-back. Backend retains the applying U3 view synchronously in StartRetryByHand.",
    "The boot-failure U4x names the node and says the control plane did not start": "internal/update/bootfailure.go sets FailedNode from RolloutProgress.Gateway; rolloutview.go composeRollback sets BootFailed + gateway-name fallback; dashboard/src/lib/rollout.ts failureLine boot-failure branch. Proven by bootfailure_test.go (node==kauri, BootFailed true) and rollback.test.ts boot-failure copy tests.",
    "GOTCHAS (a synchronous act that crosses a self-restart always reports failure) + STATUS in the same commit": "docs/GOTCHAS.md #289 and STATUS.md both in commit 157eba0f"
  },
  "summary": "retry-by-hand now STARTS the staged rollout and answers 202 at once, running detached+checkpointed so the ADR 0259 self-swap restart no longer kills the request; a second press is refused 409; and the boot-failure U4x names the gateway and says the control plane did not start.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1658 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1658, "status": "success", "commits": [ "157eba0f" ], "changed_files": [ "STATUS.md", "dashboard/src/lib/rollout.ts", "dashboard/tests/unit/rollback.test.ts", "docs/GOTCHAS.md", "internal/controlapi/updates.go", "internal/controlapi/updates_rollout_integration_test.go", "internal/update/bootfailure.go", "internal/update/bootfailure_test.go", "internal/update/rollback.go", "internal/update/rollout.go", "internal/update/rolloutview.go", "internal/update/store.go", "internal/update/update.go", "packages/openapi-spec/openapi.yaml" ], "tests": [ { "command": "go test ./internal/update/... ./internal/controlapi/... ./control-plane/cmd/control-plane/", "exit_code": 0 }, { "command": "go vet ./internal/update/... ./internal/controlapi/... ./control-plane/...", "exit_code": 0 }, { "command": "golangci-lint run ./internal/update/...", "exit_code": 0 }, { "command": "npx vitest run (dashboard, 1753 passed)", "exit_code": 0 }, { "command": "npx vue-tsc --noEmit (dashboard)", "exit_code": 0 }, { "command": "node packages/openapi-spec/scripts/generate-client.mjs --check", "exit_code": 0 } ], "criteria": { "Handler test: retry-by-hand returns 202 before the rollout finishes; a second press while it runs is refused plainly, not queued twice": "internal/controlapi/updates_rollout_integration_test.go TestRolloutHandler_RetryByHand_StartsAndRefusesSecondPress — first press 202 while canary blocked (rollout unfinished), second press 409, released retry finishes and quarantines. Backed by Orchestrator.StartRetryByHand (internal/update/rollback.go) claiming synchronously via retryMu/retrying + durable checkpoint.", "Surface test: after a 202 the surface is on U3; a 502 on a poll mid-rollout keeps U3 (no error state) and the next good read lands U4/U4x": "dashboard/tests/unit/rollback.test.ts 'after a by-hand retry the surface holds U3 across a restart 502 (#1658)' — retry -> U3, scripted 502 poll keeps rolling-out with no updates-unreachable, next good read lands rolled-back. Backend retains the applying U3 view synchronously in StartRetryByHand.", "The boot-failure U4x names the node and says the control plane did not start": "internal/update/bootfailure.go sets FailedNode from RolloutProgress.Gateway; rolloutview.go composeRollback sets BootFailed + gateway-name fallback; dashboard/src/lib/rollout.ts failureLine boot-failure branch. Proven by bootfailure_test.go (node==kauri, BootFailed true) and rollback.test.ts boot-failure copy tests.", "GOTCHAS (a synchronous act that crosses a self-restart always reports failure) + STATUS in the same commit": "docs/GOTCHAS.md #289 and STATUS.md both in commit 157eba0f" }, "summary": "retry-by-hand now STARTS the staged rollout and answers 202 at once, running detached+checkpointed so the ADR 0259 self-swap restart no longer kills the request; a second press is refused 409; and the boot-failure U4x names the gateway and says the control plane did not start.", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#1658
No description provided.