region-ha-dead-holder-backoff
Human
Region HA P1b-2 follow-up: a dead holder whose lease has not expired costs each box at most one lock GET and one dial per 10 s per host (suspect state in the holder cache, per-address dial gate in the edge's HA forwarder, generations against stale outcomes). Astra R1 and R2 found the amplification bound open twice (stopping rule 2); Paul chose central enforcement; R3 (final) in progress. Census region-ha-dead-holder-backoff approved at 28fc3b90, re-proposed at seal 8f6a1865. Not released.
Commits
6
Discussions
0
0 open
Tasks
0/0
done
Discussions
- No discussions on this branch yet.
Tasks
- No tasks yet.
Activity
- claude agent, operated by paul@keymail.dev pushed 2d020f3c3 Region HA dead-holder backoff: a request that waited out its deadline behind another dial is not an unreachable holder
- claude agent, operated by paul@keymail.dev pushed 0de2bcd89 Region HA dead-holder backoff: every holder dial goes through the gate (Astra R3 READY AFTER FIXES, P2-1; census approved at c88f58a9; the coordinator's reversed ruling). forwardDialGate now serializes a holder address's TCP dials: at most one is in flight, always. After a dial connects, the next waiter takes the gate and dials while the rest keep waiting on it; a burst toward a healthy holder dials one at a time. A dial that fails answers every one of its waiters with its error, whenever it fails (a black-holed dial fails at its deadline, when its standing window for later arrivals has also run out), and later arrivals until its forwardDialTimeout has run out. Each caller's own deadline (forwardTransport's forwardDialTimeout) bounds its whole wait, queueing and dial together: the dial in flight is detached from its caller's cancellation but keeps its deadline. No connection is shared across TLS server names. TestForwardDialGate gains: after a success the next waiter takes the gate (second dial held: at most one at once; it fails: the remaining waiters share its error with no further dial), a healthy burst dials one at a time, and a waiter's deadline bounds its queueing. TestDeadHolderGuardRealWiring unchanged and green. Census: the edge envelope re-pinned in the same overlay; unit rows and seal unchanged (8f6a1865). Not released.
- claude agent, operated by paul@keymail.dev pushed 68c172fc1 Merge remote-tracking branch 'origin/main' into region-ha-dead-holder-backoff
- claude agent, operated by paul@keymail.dev pushed c88f58a90 Region HA dead-holder backoff, round 2 (final) fixes: the dial bound enforced centrally (Paul's ruling under stopping rule 2, after Astra's re-review of 28fc3b90 found P2-1 and P2-2 not addressed; P2-3 addressed and the census approved). The edge's forward transport, one per holder address, now dials through a forwardDialGate: at most one TCP dial to a holder is in flight. Dials that arrive meanwhile wait for its outcome within their own forwardDialTimeout; a failure answers every waiter at once with its error, and every dial that arrives until the failed dial's forwardDialTimeout has run out, so a box that refuses at once costs no more dials than one that does not answer; a success lets each waiter dial its own connection. The dial in flight is detached from its caller's cancellation, so a visitor hanging up does not fail the others. Each failed forward reports ForwardUnreachable and the cache's generation rule lands one of them. The bound holds whatever the cache believes (cold entry, live entry after a success, idle pool dropped), so round 1's cache-level connection gate, NoteConnected and the GotConn hook are removed as redundant, with their tests. P2-2: a forward that answers while a suspect's revalidation read runs (no entry in the cache) makes the box that answered the holder and invalidates the read, so its failure no longer renews the suspicion; it sets nothing when no read is in flight or when this box taking the lease (a drop) already invalidated it. Guard test TestDeadHolderGuardRealWiring (package edge_test, the real activator Service over an ExecBackend and the lock fixture, through the real edge scene via forwardha_export_test.go): the holder serves one forward; then its listener is closed, its connections cut and annie's idle forward connections dropped while its lease and the cache entry stay live; 20 concurrent requests make exactly one dial (counted at the dial seam) and get 20 x 503 Retry-After: 10, both with the dial refused at once and black-holed; then sequential requests within 10 s make no dial and no lock read. Also TestForwardDialGate, TestSuccessDuringRevalidationWins (success; lease acquisition first), TestSuspectWindowEndReadsOnce (20 failures under one generation land once), TestForwardHANoteCarriesTheGen. N-HA10 kept, 50,000 bound kept, no new copy, no new S3 request. Census re-proposed under the same NAME: Edge.frontForwardHA body only, read sites unchanged; activator and edge envelopes re-pinned. Not released.
- claude agent, operated by paul@keymail.dev pushed 28fc3b906 Region HA dead-holder backoff, round 1 fixes (Astra R1 READY AFTER FIXES, three P2s; census approved at 39f6687d, re-proposed here). P2-1: a per-host connection gate. A positive holder entry with no confirmed connection lets one request dial; concurrent requests wait on that first connection, bounded by holderConnectWait (edge.ForwardDialTimeout plus 500 ms for the hop's set-up); when it connects they forward, when it cannot they get the suspect refusal, and a gate that never reports is abandoned so the next request dials. The connection is signalled from the transport (httptrace GotConn, dialled or reused, TCP and TLS) through the new HAForwarder.NoteConnected, before any answer, so a slow app never holds the gate; a confirmed connection lifts the gate until the entry changes. P2-2: a read that revalidates an expired suspect and fails (error or timeout) renews the window for the same box and refuses its initiator and waiters, unless news arrived while it ran. P2-3: every entry carries a generation, handed out with each forward (ForwardDecision.Gen, ForwardResult.Gen, NoteConnected) and renewed by every put, every first-connection attempt and every answer from the named box; removal invalidates it. An unreachable, connected or unconnected outcome under an older generation is ignored, so a stale failure cannot undo a success, a holder header or this box taking the lease. A read overtaken by news no longer hands out its uncached answer; its callers look again. N-HA10 kept, 50,000 bound kept, no new copy, no new S3 request. Witnesses: TestFirstDialGatesConcurrentRequests (20 concurrent requests, first dial held open: exactly one dial; connects, unreachable, ended without connecting), TestFirstDialWaitIsBounded, TestSuspectWindowEndForwardsOnce (now waiting on the connection), TestSuspectRevalidationFailureRenewsTheWindow (error, timeout, newer news), TestStaleUnreachableIsIgnored (same-ref success, holder header, lease acquisition), TestForwardHAConnectedBeforeTheAnswer (edge: GotConn while the holder's app holds the answer, Gen round-trips, reused connections count). Census re-proposed under the same NAME: Edge.frontForwardHA and Service.ForwardTarget body only, read sites unchanged; activator and edge envelopes re-pinned. Not released.
- claude agent, operated by paul@keymail.dev pushed 39f6687d9 Region HA dead-holder backoff (P1b-2 follow-up). A forward for a born-HA host that cannot connect to its holder now marks that holder suspect for 10 s (holderSuspectTTL) in the activator's holder cache instead of dropping the entry. While a host is suspect, ForwardTarget answers a refusal (edge.ForwardDecision{Refuse: true}, which replaces the bare ref string) and the edge's frontForwardHA answers it at the front door with the existing unreachable answer, 503, Retry-After: 10, "instance is waking elsewhere; retry shortly", with no lock read, no dial, no note, no local wake and no per-request step (N-HA10 kept). After the window the next request reads lock.json once; if it still names the same box, only the caller that read forwards (one dial), queued callers are refused, and the box is suspect again until that forward's outcome says otherwise. So a dead holder whose lease has not run out costs each box one lock GET and one failed dial per 10 s per host instead of one of each per request. ForwardResult gains Ref (the box forwarded to). A suspect entry is cleared when this box takes the lease, when a forward to any box comes back with an answer (that box becomes the holder), and when an X-Carlos-Holder names a box (or drops on none or this box); an old unreachable forward never overwrites a negative entry or one naming another box. Once the lease expires and OwnerTerminated says the holder is terminated, the first request after the window reads no live holder and P1b-1's takeover serves it here. Legacy hosts, scheduled ticks, regional names and hops are unchanged; no new copy, no new S3 polling. Tests: TestDeadHolderCostsOneReadAndDialPerWindow, TestSuspectWindowEndForwardsOnce, TestSuspectClearedByTakingTheLease, TestSuspectClearedByAHolderHeader, TestSuspectClearedByASuccessfulForward, TestUnreachableKeepsNewerNews, TestSuspectThenExpiredLeaseTakesOver, TestFrontForwardSuspectRefusalRunsNoLocalStep. Census region-ha-dead-holder-backoff proposed (Edge.frontForwardHA body, Service.ForwardTarget sites; activator and edge envelopes re-pinned), awaiting the reviewer. Not reviewed, not released.