broker: DigitalOcean.Destroy has no retry on a transient DO 5xx — release leg reds on a single Gateway Timeout #749
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Reference
Matou/idss#749
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Failure
Drive
20260824T164237Z, legrelease(signaturecd27eeace366) went RED with:All 19 prior legs were green (
artifacts/legs.json); this is the terminal honesty leg. The test's own POST is atapp/tests/e2e/journey.rented.spec.ts:686-694.Trace
broker/internal/broker/http.go:245-261— thePOST /v1/gateways/releasehandler wraps any error fromRentals.Releaseas a barehttp.StatusBadGateway(502), passing the underlying message through verbatim (http.go:261).broker/internal/broker/rentals.go:339-352(Rentals.Release) callsr.prov.Destroy(ctx, serverID)once and returns its error straight through with no retry of its own.broker/internal/broker/provider_do.go:179-194(DigitalOcean.Destroy) issues exactly oneDELETE /v2/droplets/{id}call viad.do(provider_do.go:420-448). DO answered that single call with a 504 Gateway Timeout, whichd.doturns into a terminal*doRefusal(provider_do.go:437-446) — there is no loop, no backoff, nothing that distinguishes a transient gateway blip from a real refusal.This is asymmetric with the other two DO call sites in the same file, both of which already retry transient failures, both hardened after past DO-blip incidents:
ensureSSHKey(provider_do.go:322-364) retries up tosshKeyPostRetries(=3, provider_do.go:60) — comment at provider_do.go:318-321 cites #677 ("a raw 404 from a post-create-style infra blip").pollActive(provider_do.go:368-416) tolerates GET errors mid-poll and keeps trying — comment at provider_do.go:378-384 cites #672.Destroynever got the equivalent treatment, so the one DO call in the release path that is NOT already hardened against a transient 5xx is exactly the one that redded this drive.Not a leak
The droplet at
134.199.144.149still answering ping/ssh after the red (logs/droplet-do-forensics.txt) is expected — the harness's keep-on-red contract (#716,app/tests/e2e/fixtures/rented.ts:162) deliberately preserves a red drive's box for evidence, and the pre-rent sweep (#748,scripts/lib/rehearsal-droplet.sh:648) reaps a kept-on-red box before the next same-slug drive claims it. No standing-drive violation here, no separate residual to hand back.Suspected layer / what plugging needs
Provider layer (
broker/internal/broker/provider_do.go), specificallyDigitalOcean.Destroy. This needs a design call, not a mechanical edit:d.client.Donetwork errors);sshKeyPostRetries+d.PollInterval, or its own budget);dropletName's GET (provider_do.go:199-211), which runs before the DELETE and could hit the same transient class.A fix should add a scripted-fakeDO test alongside the existing
TestDO_DestroyTreats404AsGone/TestDO_DestroyReapsTheDropletsSSHKey(provider_do_test.go:479-549) that has the DELETE fail once with a 504 then succeed, assertingDestroystill returns nil.(Recent healer history shown for #720 is for an unrelated signature/leg —
enroll-configure, siga26965b5356b— no prior resistance on this signature.)drive
20260824T164237Zred atrelease:broker refused the release of rehearsal-c.idss.nz: 502 {"error":"broker: DigitalOcean refused: Gateway Timeout: error code: 504"}evidence:
test-results/…/20260824T164237Z/on matou-workstation (legs.json, droplet-journal.txt, trace) — a representative screenshot is attached here if one was captured (#596)swarm-claim host=elitebook-distributed-server-03 run=9760
(automated multi-host claim — lowest live claim id works this ticket)
Ruled by agent under ADR 0174 — veto anytime.
The ticket flagged the retry policy for
DigitalOcean.Destroyas a design call. It is a two-way door: the whole change is a bounded transient-retry on the teardown path, revertible by a later commit and proven by scripted-fakeDO tests. It touches nothing on the one-way-door list (no credentials, no security widening, no member trust accept, no data destruction — a retry makes the intended delete more reliable, it does not delete anything extra; a transient failure today leaves the box up, the opposite of over-destruction — no non-routine spend).The ruling (the three design questions the ticket raised):
*doRefusalwith status>= 500(so 502/503/504 and 500) — plus any non-typed error fromclient.Do(a network/timeout error, whichdo()wraps rather than turning into a*doRefusal). A typed 4xx (404 gone, 422 duplicate, 401 auth) is terminal and surfaces on the first call — never spun on. This is narrower thanensureSSHKey's blanket non-422 retry: a genuine refusal on the release leg still fails fast.destroyRetries = 3, spaced byd.PollIntervalviasleepCtx(context-cancellable) — mirrorssshKeyPostRetries(#677) and the same transient classpollActiverides out (#672). Small and fixed: the release leg is a drive's last honest leg, so a persistent failure must surface fast, not spin on a bad token.dropletName's pre-delete GET too? Yes — it runs before the DELETE and hits the same transient class; a blip there would silently skip the #708 key reap (a stale-key leak). Both teardown calls now go through onedoRetryTransienthelper.What proves it:
TestDO_DestroyRetriesTransientDeleteGatewayTimeout(one 504 then success →Destroyreturns nil, exactly 2 DELETEs),TestDO_DestroyFailsLoudWhenDeleteNeverRecovers(every DELETE 504s → fails loud after exactlydestroyRetries, no masked live box, ADR 0047), andTestDO_DestroyDoesNotRetryTerminalRefusal(a 401 → surfaced on the first DELETE, budget not spent). All existing DO contract tests still green.close-report for #749 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope
idss-rental-expires-tag on a LIVE rental once the broker actually deploys (#741's broker half is merged but not installed) #745