rehearsal: retiring a standing slug never releases its rental — the broker renews the retired gateway's lease every pass, so rehearsal-c/-d billed for a day past retirement (rental-reap kept them by rule) #991

Closed
opened 2026-08-29 14:32:48 +00:00 by ben · 2 comments
Owner

Symptom

doctl compute droplet list on 2026-08-29 14:30Z: idss-gateway-rehearsal-c-b655 (24 h past its slug's retirement, #941) and idss-gateway-rehearsal-d-ec79 (retired this afternoon, LE-walled #986–#989) both active and billing. rental-reap.sh keeps both every hour — correctly, by its own rule: each carries a live idss-rental-expires-* lease that advances +3600 s every sweep (1788093909 → 1788097509).

Cause

The broker's reaper renews the lease of every healthy box on every pass (rentals_release_owed_test.go:19, #741). A rented gateway therefore lives until something calls POST /v1/gateways/release with the wizard's claim secret. Retiring a standing slug is done by hand — mv test-results/standing-rented standing-rented.retired-<slug>-<date> + editing REHEARSAL_SLUG — and nothing in that procedure releases the rental. The executor's next tick then says standing renew: no host/secret on record — nothing to renew and forgets the box, while the broker keeps it alive forever. The claim secret is right there in the retired dir (state/… claimSecret), and oc_rented_teardown already knows the call.

Rule it needs

  • A retire-standing.sh (or an executor verb) that does the slug rotation atomically: release the rental through the broker with the retired state's claim secret (POST $IDSS_BROKER_URL/v1/gateways/release {"host":"<slug>.idss.nz"} → 204; the broker destroys the box and clears its DNS, #758), then move the standing home, then rewrite REHEARSAL_SLUG. Loud on a non-204 — a retired slug whose rental is still open must be named, never silent.
  • rental-reap.sh names a kept box whose slug is not the executor's current REHEARSAL_SLUG and whose lease is only alive because the broker keeps renewing it (flagged=, not kept=) — the leak this ticket found would then be visible in the hourly log instead of on the DO bill.
  • GOTCHAS entry: "retiring a standing slug by mv leaves the broker renewing its gateway forever".
  • Offline test: the retire script against a fake broker (204 / 4xx / unreachable) + the reap classifier on a renewed-but-unowned lease.

The two clan-lab-rehearsal-* boxes in the same listing are member-device targets carrying clan-lab-expires-* tags; clan-lab-reap.sh reaped a sibling at 13:17Z and will take those when they lapse — not this ticket.

## Symptom `doctl compute droplet list` on 2026-08-29 14:30Z: `idss-gateway-rehearsal-c-b655` (24 h past its slug's retirement, #941) and `idss-gateway-rehearsal-d-ec79` (retired this afternoon, LE-walled #986–#989) both **active and billing**. `rental-reap.sh` keeps both every hour — correctly, by its own rule: each carries a live `idss-rental-expires-*` lease that advances +3600 s every sweep (`1788093909 → 1788097509`). ## Cause The broker's reaper **renews the lease of every healthy box on every pass** (`rentals_release_owed_test.go:19`, #741). A rented gateway therefore lives until something calls `POST /v1/gateways/release` with the wizard's claim secret. Retiring a standing slug is done by hand — `mv test-results/standing-rented standing-rented.retired-<slug>-<date>` + editing `REHEARSAL_SLUG` — and **nothing in that procedure releases the rental**. The executor's next tick then says `standing renew: no host/secret on record — nothing to renew` and forgets the box, while the broker keeps it alive forever. The claim secret is right there in the retired dir (`state/…` `claimSecret`), and `oc_rented_teardown` already knows the call. ## Rule it needs - [ ] A `retire-standing.sh` (or an executor verb) that does the slug rotation atomically: release the rental through the broker with the retired state's claim secret (`POST $IDSS_BROKER_URL/v1/gateways/release {"host":"<slug>.idss.nz"}` → 204; the broker destroys the box and clears its DNS, #758), then move the standing home, then rewrite `REHEARSAL_SLUG`. Loud on a non-204 — a retired slug whose rental is still open must be named, never silent. - [ ] `rental-reap.sh` names a kept box whose slug is **not** the executor's current `REHEARSAL_SLUG` and whose lease is only alive because the broker keeps renewing it (`flagged=`, not `kept=`) — the leak this ticket found would then be visible in the hourly log instead of on the DO bill. - [ ] GOTCHAS entry: "retiring a standing slug by `mv` leaves the broker renewing its gateway forever". - [ ] Offline test: the retire script against a fake broker (204 / 4xx / unreachable) + the reap classifier on a renewed-but-unowned lease. The two `clan-lab-rehearsal-*` boxes in the same listing are member-device targets carrying `clan-lab-expires-*` tags; `clan-lab-reap.sh` reaped a sibling at 13:17Z and will take those when they lapse — not this ticket.

swarm-claim host=elitebook-distributed-server-03 run=14150
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=14150 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #991 — status success

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

envelope
{
  "issue": 991,
  "status": "success",
  "commits": [
    "d18706641afdbbb9f2492006973bec0112338668"
  ],
  "changed_files": [
    "STATUS.md",
    "docs/GOTCHAS.md",
    "scripts/rental-reap.sh",
    "scripts/retire-standing.sh",
    "scripts/tests/rental-reap-test.sh",
    "scripts/tests/retire-standing-test.sh"
  ],
  "tests": [
    {
      "command": "bash scripts/tests/retire-standing-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash scripts/tests/rental-reap-test.sh",
      "exit_code": 0
    }
  ],
  "criteria": {
    "retire-standing.sh releases the rental with the retired state's claim secret then moves the home then rewrites REHEARSAL_SLUG; loud on non-204": "scripts/retire-standing.sh: POST /v1/gateways/release (Bearer oc_standing_secret) gated on 204; non-204 (incl. unreachable->000) dies loud with the home in place and slug unrotated, then mv + REHEARSAL_SLUG rewrite. Proven by scripts/tests/retire-standing-test.sh checks 1 (204 gates rotation), 2 (409 aborts loud), 3 (unreachable aborts)",
    "rental-reap.sh names (flagged= not kept=) a kept box whose slug is not the executor's current REHEARSAL_SLUG and whose lease is only alive because the broker keeps renewing it": "scripts/rental-reap.sh leased-drive-box branch derives box_slug and FLAGS when box_slug != REHEARSAL_SLUG (sourced from swarm-identity.sh); proven by scripts/tests/rental-reap-test.sh check 4c (retired slug flagged) + 4d (current slug still kept)",
    "GOTCHAS entry: retiring a standing slug by mv leaves the broker renewing its gateway forever": "docs/GOTCHAS.md #129",
    "Offline test: the retire script against a fake broker (204/4xx/unreachable) + the reap classifier on a renewed-but-unowned lease": "scripts/tests/retire-standing-test.sh 6/6 (204/4xx/unreachable/no-secret/facts-absent/usage); scripts/tests/rental-reap-test.sh 16/16 (new 4c/4d)"
  },
  "summary": "retire-standing.sh releases a standing rental before rotating its slug, and rental-reap.sh flags a leased drive box whose slug is no longer the current REHEARSAL_SLUG, so a hand-retired gateway can no longer bill forever behind the broker's renew.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #991 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 991, "status": "success", "commits": [ "d18706641afdbbb9f2492006973bec0112338668" ], "changed_files": [ "STATUS.md", "docs/GOTCHAS.md", "scripts/rental-reap.sh", "scripts/retire-standing.sh", "scripts/tests/rental-reap-test.sh", "scripts/tests/retire-standing-test.sh" ], "tests": [ { "command": "bash scripts/tests/retire-standing-test.sh", "exit_code": 0 }, { "command": "bash scripts/tests/rental-reap-test.sh", "exit_code": 0 } ], "criteria": { "retire-standing.sh releases the rental with the retired state's claim secret then moves the home then rewrites REHEARSAL_SLUG; loud on non-204": "scripts/retire-standing.sh: POST /v1/gateways/release (Bearer oc_standing_secret) gated on 204; non-204 (incl. unreachable->000) dies loud with the home in place and slug unrotated, then mv + REHEARSAL_SLUG rewrite. Proven by scripts/tests/retire-standing-test.sh checks 1 (204 gates rotation), 2 (409 aborts loud), 3 (unreachable aborts)", "rental-reap.sh names (flagged= not kept=) a kept box whose slug is not the executor's current REHEARSAL_SLUG and whose lease is only alive because the broker keeps renewing it": "scripts/rental-reap.sh leased-drive-box branch derives box_slug and FLAGS when box_slug != REHEARSAL_SLUG (sourced from swarm-identity.sh); proven by scripts/tests/rental-reap-test.sh check 4c (retired slug flagged) + 4d (current slug still kept)", "GOTCHAS entry: retiring a standing slug by mv leaves the broker renewing its gateway forever": "docs/GOTCHAS.md #129", "Offline test: the retire script against a fake broker (204/4xx/unreachable) + the reap classifier on a renewed-but-unowned lease": "scripts/tests/retire-standing-test.sh 6/6 (204/4xx/unreachable/no-secret/facts-absent/usage); scripts/tests/rental-reap-test.sh 16/16 (new 4c/4d)" }, "summary": "retire-standing.sh releases a standing rental before rotating its slug, and rental-reap.sh flags a leased drive box whose slug is no longer the current REHEARSAL_SLUG, so a hand-retired gateway can no longer bill forever behind the broker's renew.", "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.

Dependencies

No dependencies set.

Reference
Matou/idss#991
No description provided.