updates: the land stage's artifact download has no deadline, and a refusal leaves no journal line (hardening) #1660

Closed
opened 2026-09-20 09:41:36 +00:00 by ben · 1 comment
Owner

Hardening, not a drive finding — no run has shown this failing. It came out of misreading #1614 run 20260920T083206Z (a refusal that left no journal line looked like a hang; see #1614 comments 51549 → 51560).

Two gaps in the land stage (internal/update/land.go)

  1. The artifact download has no deadline. NewHTTPArtifactFetcher(nil) falls back to http.DefaultClient, which has no timeout, and the rollout's context carries none. A half-open connection to get.idss.nz would park the rollout in land forever — and since ADR 0259 rule 4 a rollout in flight refuses every operator deploy, so the whole fleet wedges until the unit is restarted, with no attempt ever counted. Give the fetch a response-header timeout and a STALL-bounded body read (no progress for N seconds → fault), not a flat total sized for metadata: a 25 MB control plane on a slow home line must still land (the pull rail's lesson, GOTCHAS #255). A fetch that exceeds it is a transport fault: the attempt fails loudly and is counted (ADR 0067).
  2. The land stage is silent. A refusal (fingerprint mismatch) writes nothing to the journal — the only record is the rollout view. Log one line per artifact (role, bytes, verified) and one WARN on refusal naming the role and both digests' prefixes (ADR 0100: fail loud).

Acceptance

  • Seam test: a fetcher whose body stalls returns a transport fault within the stall bound; a slow-but-progressing body of full size still lands.
  • The production wiring passes a configured client (assert it is not http.DefaultClient).
  • A refusal and a successful land each leave their journal line (log-capture test).
  • GOTCHAS + STATUS in the same commit.
Hardening, not a drive finding — no run has shown this failing. It came out of misreading #1614 run `20260920T083206Z` (a refusal that left no journal line looked like a hang; see #1614 comments 51549 → 51560). ## Two gaps in the land stage (`internal/update/land.go`) 1. **The artifact download has no deadline.** `NewHTTPArtifactFetcher(nil)` falls back to `http.DefaultClient`, which has no timeout, and the rollout's context carries none. A half-open connection to get.idss.nz would park the rollout in `land` forever — and since ADR 0259 rule 4 a rollout in flight refuses every operator deploy, so the whole fleet wedges until the unit is restarted, with no attempt ever counted. Give the fetch a response-header timeout and a STALL-bounded body read (no progress for N seconds → fault), not a flat total sized for metadata: a 25 MB control plane on a slow home line must still land (the pull rail's lesson, GOTCHAS #255). A fetch that exceeds it is a transport fault: the attempt fails loudly and is counted (ADR 0067). 2. **The land stage is silent.** A refusal (fingerprint mismatch) writes nothing to the journal — the only record is the rollout view. Log one line per artifact (role, bytes, verified) and one WARN on refusal naming the role and both digests' prefixes (ADR 0100: fail loud). ## Acceptance - [ ] Seam test: a fetcher whose body stalls returns a transport fault within the stall bound; a slow-but-progressing body of full size still lands. - [ ] The production wiring passes a configured client (assert it is not `http.DefaultClient`). - [ ] A refusal and a successful land each leave their journal line (log-capture test). - [ ] GOTCHAS + STATUS in the same commit.

close-report for #1660 — status success

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

envelope
{
  "issue": 1660,
  "status": "success",
  "commits": [
    "eb1388c659ec82d231f64fc50a762602a96129ca"
  ],
  "changed_files": [
    "internal/update/land.go",
    "internal/update/land_test.go",
    "control-plane/cmd/control-plane/whole_composition.go",
    "docs/GOTCHAS.md",
    "STATUS.md"
  ],
  "tests": [
    {
      "command": "go test ./internal/update/",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/update/ ./control-plane/cmd/control-plane/",
      "exit_code": 0
    },
    {
      "command": "go build -o /tmp/cp-check ./control-plane/cmd/control-plane/",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Seam test: a fetcher whose body stalls returns a transport fault within the stall bound; a slow-but-progressing body of full size still lands": "internal/update/land_test.go TestHTTPArtifactFetcher_BodyStallFaults (stalled body faults naming 'stall' within a 2s bound) and TestHTTPArtifactFetcher_SlowButProgressingLands (60x1024B chunks at 5ms gaps under a 200ms stall bound land whole) — via readStallBounded in land.go (watchdog closes body on no-progress-for-stall, every byte resets the clock)",
    "The production wiring passes a configured client (assert it is not http.DefaultClient)": "control-plane/cmd/control-plane/whole_composition.go now passes update.NewArtifactHTTPClient() (cloned transport with ResponseHeaderTimeout) not nil/DefaultClient; asserted by TestNewArtifactHTTPClient_IsConfiguredNotDefault (not http.DefaultClient, ResponseHeaderTimeout>0); NewHTTPArtifactFetcher(nil) also now builds NewArtifactHTTPClient, never http.DefaultClient",
    "A refusal and a successful land each leave their journal line (log-capture test)": "FleetLander.WithLog + refuse/digestPrefix + per-artifact INFO line in land.go; TestFleetLander_LogsVerifiedArtifact (INFO role+bytes+verified=true) and TestFleetLander_LogsRefusalWarn (WARN naming role and both digests' prefixes)",
    "GOTCHAS + STATUS in the same commit": "commit eb1388c6 changes docs/GOTCHAS.md (#290) and STATUS.md alongside the code"
  },
  "summary": "The land stage's artifact download now bounds by response-header timeout + stall, and every verified land and refusal leaves a journal line.",
  "blockers": []
}
**close-report** for #1660 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1660, "status": "success", "commits": [ "eb1388c659ec82d231f64fc50a762602a96129ca" ], "changed_files": [ "internal/update/land.go", "internal/update/land_test.go", "control-plane/cmd/control-plane/whole_composition.go", "docs/GOTCHAS.md", "STATUS.md" ], "tests": [ { "command": "go test ./internal/update/", "exit_code": 0 }, { "command": "go vet ./internal/update/ ./control-plane/cmd/control-plane/", "exit_code": 0 }, { "command": "go build -o /tmp/cp-check ./control-plane/cmd/control-plane/", "exit_code": 0 } ], "criteria": { "Seam test: a fetcher whose body stalls returns a transport fault within the stall bound; a slow-but-progressing body of full size still lands": "internal/update/land_test.go TestHTTPArtifactFetcher_BodyStallFaults (stalled body faults naming 'stall' within a 2s bound) and TestHTTPArtifactFetcher_SlowButProgressingLands (60x1024B chunks at 5ms gaps under a 200ms stall bound land whole) — via readStallBounded in land.go (watchdog closes body on no-progress-for-stall, every byte resets the clock)", "The production wiring passes a configured client (assert it is not http.DefaultClient)": "control-plane/cmd/control-plane/whole_composition.go now passes update.NewArtifactHTTPClient() (cloned transport with ResponseHeaderTimeout) not nil/DefaultClient; asserted by TestNewArtifactHTTPClient_IsConfiguredNotDefault (not http.DefaultClient, ResponseHeaderTimeout>0); NewHTTPArtifactFetcher(nil) also now builds NewArtifactHTTPClient, never http.DefaultClient", "A refusal and a successful land each leave their journal line (log-capture test)": "FleetLander.WithLog + refuse/digestPrefix + per-artifact INFO line in land.go; TestFleetLander_LogsVerifiedArtifact (INFO role+bytes+verified=true) and TestFleetLander_LogsRefusalWarn (WARN naming role and both digests' prefixes)", "GOTCHAS + STATUS in the same commit": "commit eb1388c6 changes docs/GOTCHAS.md (#290) and STATUS.md alongside the code" }, "summary": "The land stage's artifact download now bounds by response-header timeout + stall, and every verified land and refusal leaves a journal line.", "blockers": [] } ``` </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.

Dependencies

No dependencies set.

Reference
Matou/idss#1660
No description provided.