activator: wake slots, fix Astra R1 (recheck, retire, health window)
- A queued wake asks the fence/shutdown/retired/disabled refusals again once it holds a slot (refuseWakeLocked), so a route turned off while queued starts nothing. - RetireExcept cancels a wake still queued for a slot (e.admitted). - e.wakeStart is set at admission, so queue time never shortens a candidate build's health window. - Census proposal census-ruling-wake-storm-cap (three units).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/superpowers/notes/census-proposal-wake-storm-cap.md+25 −0internal/activator/activator.go+45 −20internal/activator/wakeslots_test.go+103 −0internal/provision/testdata/plan14-root-reads-chain.tsv+1 −0internal/provision/testdata/plan14-root-reads-wake-storm-cap.tsv+9 −0
CI cancelled — superseded by a newer push — run details
Intent
<cross-session-message from="uds:/run/user/1001/cc-socks/2077682.sock" from-name="titogo-cb" from-mode="bypass"> From titogo-cb: confirmed. The journal showed "agent: memwatch disabled (CARLOS_HOST_METRICS unset)" at 14:20:32. I appended CARLOS_HOST_METRICS=cloudwatch to /etc/carlos/host.env (backup at /root/host.env.bak-20261103) and did NOT restart carlos-edge; it waits for your next roll. I'll set alerts_email once Carlos/Host datapoints appear. Also: zram is live on carlos-tito-ie (your harden-box.sh, applied over SSM at 14:28: zram0 15.4G, swappiness 180). The script is now in Tito's carlos-infrastructure (PR open), deliberately kept out of host-init.sh because changing user_data stop/starts every region box. Next I'm doing titogo.slice in the titogo repo; I'll send you the numbers before it reaches the box. </cross-session-message>
<cross-session-message from="uds:/run/user/1001/cc-socks/2077682.sock" from-name="titogo-cb" from-mode="bypass"> From titogo-cb: proposed titogo.slice numbers, for your review BEFORE anything reaches the box. Branch: instance-memory-slice, not pushed. Measured on carlos-tito-ie (32 GB) at 14:40 UTC: titogo@ units use 7.6 GB across 66, titogo-canary@ 1.2 GB across 11 (8.8 GB together, about 27%), carlos.slice 1.4 GB, system.slice 13.6 GB including page cache. - titogo.slice (new, at the root beside carlos.slice; holds only titogo@ and titogo-canary@, so the router, relay, controld and litestream stay outside it): MemoryHigh=50%, MemoryMax=60%, MemorySwapMax=8G. - Each titogo@ and titogo-canary@: Slice=titogo.slice, MemoryHigh=224M, MemoryMax=256M (as before), MemorySwapMax=256M (your swap = MemoryMax rule). One deliberate deviation from "size it against what's left after carlos.slice's 80%". Taken literally that leaves titogo under 20% (6.4 GB), and the instances already use 27% at idle, so the slice's OOM killer would start killing accounts straight away. I'm treating 80% as carlos.slice's ceiling rather than a reservation. The two ceilings overlap (80% + 60%), but each one stops its own side from taking the box, and carlos.slice really holds 1.4 GB. If you'd rather the ceilings not overlap, the alternative is lowering carlos.slice on this box, and that's your call. MemoryHigh is 10 percentage points under MemoryMax on the slice, and 32 MB (12.5%) under it per unit. Go's GOMEMLIMIT comes from the unit's memory.max minus 96 MiB, which is 160 MiB. The slice's swap cap is an absolute 8G, not a percentage: systemd takes a swap percentage from the swap that exists when it loads the unit, and at boot zram may not be up yet. The rollout is install-instance-units.sh over SSM (install plus daemon-reload, no restarts). Units move into the slice at their next restart, which is the next titogo deploy's staggered roll. OK to proceed, or do you want changes? </cross-session-message>
<cross-session-message from="uds:/run/user/1001/cc-socks/2077682.sock" from-name="titogo-cb" from-mode="bypass"> From titogo-cb: thanks, all three noted. carlos.slice stays as it is. Installing on carlos-tito-ie waits for (a) Astra's review, (b) the PR merging, and (c) Paul's explicit go. After the daemon-reload I'll read memory.high and memory.swap.max on one running titogo@ and report which behaviour we got. Two journal findings from the outage window, FYI: de7ea1f's start-up cost is ruled out (the largest emails table is 2,838 rows, so the index build is trivial). And titogo's import-sync process is at 947 MB RSS outside any memory cap, and carlos-litestream logged 25.5k lines between 13:47 and 13:56. I'm looking at import-sync on the titogo side next. </cross-session-message>
Yes, go ahead with unblocking. Luna can review copy?
Attributed to this commit: 69.1 g CO₂e (8,185,805 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on wake-storm-cap, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.
diff --git a/docs/superpowers/notes/census-proposal-wake-storm-cap.md b/docs/superpowers/notes/census-proposal-wake-storm-cap.md| new file mode 100644 |
| index 000000000..46c05c959 |
| --- /dev/null |
| +++ b/docs/superpowers/notes/census-proposal-wake-storm-cap.md |
| @@ -0,0 +1,25 @@ |
| +# Census approval: wake-storm-cap |
| + |
| +Ruling `census-ruling-wake-storm-cap`. The independent reviewer approves or rejects every change below, 1 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26). |
| + |
| +| unit | change | read sites | what changed | |
| +|---|---|---|---| |
| +| `internal/activator/activator.go` `type Service` | body | unchanged (0) | the agent as carlos: one field, wakeSlots (chan struct{}, the wake semaphore made by New from Config.WakeSlots, default 4); declaration only, no read. | |
| +| `internal/activator/activator.go` `Service.wake` | sites | -whole:Route | the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): waits for a box-wide wake slot (acquireWakeSlot, an in-memory buffered channel) before doWake; the fence/shutdown/retired/disabled refusals move into refuseWakeLocked and are asked again after admission (one fewer direct whole-Route read here: a.disabled(e.route) now runs inside refuseWakeLocked, same value); e.wakeStart is set at admission and e.admitted marks it. Only waits and refuses more; no new read. | |
| + |
| +Envelopes re-pinned: `internal/activator`. |
| + |
| +Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner. |
| + |
| +Recorded dispositions, which each change must still satisfy: |
| + |
| +- `internal/activator/activator.go` `type Service`: authority, task B,C,D,F,J4. Basis: rev3=PROPOSED-seed; existing activator lifecycle and due-wake state plus owned seed exclusion and incarnation-keyed diagnostics; normal refusal and preparation ordering remain authoritative; PROPOSED-plans-2-box-limits adds the idleFor hook field, which only narrows idle windows;rev3=census-ruling-plans-4c-box-throttle;basis=gains the maxRunFor hook field beside idleFor (plans 4c). No read added.;rev3=census-ruling-plans-4d-lapse;basis=gains the disabledFor hook field beside maxRunFor (plans 4d). No read added.;rev3=census-ruling-remote-instance-metrics;basis=gains tenancySeq, hostTenants and hostMixed, in-memory fields for Tenancies; no read added;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: one more field, markers (markerRetry: an atomic running flag and the last log time) for retryOwedMarkers; no read added; merge of origin/main d7ae1d76: main's fields are kept as main has them (census-ruling-remote-instance-metrics: tenancySeq, hostTenants, hostMixed); this branch's change is the same as above;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: new fields for rootfs admission (rootfsArmed, rootfsSwept), the per-host gate ask and refusal memo, and residency state (lister, backoff, start ceiling, cursor, test seam); no read;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R: one new field, releaseOps (host to the in-memory release record, under a.mu); no read;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W: one new field, leaseNow (a clock seam for a worker start's headroom against the lease deadline, nil is the real clock); no read;rev3=census-ruling-region-ha-p1b2;basis=region HA P1b-2: gains the holder cache and its single-flight state; no read;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (controller ruling after branch review R1, and Paul's R2 ruling): one field, Fleet (activator.FleetWake: the box's fleet state, not on a fleet by default, on a fleet with a known label and a record reader, or on a fleet with an invalid identity), set by the agent before Start and read only by routeCurrentUnderLease. No read in the declaration. Agent, not root.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 7a fix round 1: one field, drainBudget (time.Duration), which New copies from residentDrainBudget and a rootfs entry's lease watch reads in its place, so a test's change of the package var never races a watch goroutine; declaration only, reads nothing; merge of origin/main 6f1f6ca6: main's one field, Fleet (activator.FleetWake), is kept as main has it (census-ruling-managed-fleets-1b); this branch's change is the same as above;rev3=census-ruling-region-ha-p1b3a;basis=Add bounded placement peer and diagnostic state and the over-capacity callback; no read in this declaration and no new root authority.;rev3=census-ruling-stateless-replicas-1;basis=Add coordinator, existing-record observation callback and per-host preparation locks; no read in the declaration. Task 3a: Add optional canonical storage-selection and durable deploy-ID callbacks; declaration only, no read or authority in these fields.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): adds the heldLegs map to actEntry (legs by id, under a.mu) and heldWakeHook (atomic pointer to a callback) and heldLegSeq (atomic counter) to Service. State only, in memory; no read of tenant, app or box-agent-writable input. |
| +- `internal/activator/activator.go` `Service.wake`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-carlos-run;basis=Re-digested at the pre-land merge: the body includes main's own change under census ruling 292, with no further change from this branch. the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body; the stop now carries its reason for a run it interrupts (beginStopLocked's why argument); read sites unchanged, offsets moved;rev3=census-ruling-wake-latency-1;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=logs that timer's breakdown to the journal after a successful wake (w.steps.String(), e.host, w.wakeTook); no read added;rev3=census-ruling-plans-4d-lapse;basis=cancels a wake whose row the turned-off hook names, like a fence, unless it is a move's active probe (plans 4d). One more whole-row read: the row handed to the hook (a.disabled). Only refuses.;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: a refusal before the lease is reported once per change (noteRootfsRefusal) instead of a wake-failure event; the proc, generation and replica are installed through installProcLocked (which puts a resident under its lease watch before the fence); residency notes the outcome (noteResidentWakeLocked); same generation values;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R [pf R3.5]: the wake's context ceiling is wakeCeilingFor(e.route): the old 5 minutes for a binary row, 5 minutes plus runs.MaxTimeout for a rootfs row (room for a release inside the wake); new site +whole:Route (e.route to wakeCeilingFor, which reads Runtime only); no other change;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (branch review R1 P1-1): the wake's context is also cancelled before doWake when RetireExcept has marked the entry retired (e.retired, in memory under a.mu), as it is for a fence or a shutdown. Read sites unchanged (13). Agent, not root; it only refuses more.;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Carry successful hold preparation into its wake, preserve actual mode in the generation and OnWake projection, and project serving version/mode through the narrow registry writer before releasing wake waiters. Final review I1: SetServingMode only for non-worker successful wakes with a nonempty spawned version and either a stateless generation or a mode transition from the route. Ordinary stateful wakes leave rollout status and the wake critical path unchanged.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): adds a.cancelHeldLegsLocked(e, 0) on the failed-wake path before the entry is deleted, and after close(e.ready) on success calls a.noteHeldAdmissible(e.host), the non-blocking held wake callback, outside a.mu. No read added. |
| + |
| +New dispositions, which census-propose wrote and the reviewer checks against the unit's reads and the diff: |
| + |
| +- new `internal/activator/activator.go:Service.refuseWakeLocked`: reads +whole:Route; written legacy, accepted-legacy, frozen |
| + |
| +Seal: `09ad1d7267b9598c64e89ec0faa7b18839c785c5c63905b398afe681cf9777c6` → `b0fc198c53bb0dacba33a54c3d8bf8fe5ac07d94b76a31b8a69e9411115ecd85`. |
| + |
| +Overlay: `internal/provision/testdata/plan14-root-reads-wake-storm-cap.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`. |
diff --git a/internal/activator/activator.go b/internal/activator/activator.go| index 4371730de..cb8ef6e50 100644 |
| --- a/internal/activator/activator.go |
| +++ b/internal/activator/activator.go |
| @@ -760,9 +760,12 @@ type actEntry struct { |
| // that observation's context, both registered in the awake transition |
| // (armFirstWatchLocked) and read by watchFirstWake's goroutine. All but |
| // plan are written under a.mu. |
| - plan WakePlan |
| - firstWake bool |
| - wakeStart time.Time |
| + plan WakePlan |
| + firstWake bool |
| + wakeStart time.Time |
| + // admitted is set, under a.mu, once the wake holds a wake slot |
| + // (wakeslots.go). RetireExcept cancels a wake that is still queued. |
| + admitted bool |
| unexpectedExit bool |
| firstWatch context.CancelFunc |
| firstWatchCtx context.Context |
| @@ -1958,6 +1961,23 @@ func (a *Service) consumeDueTime(e *actEntry) { |
| } |
| } |
| +// refuseWakeLocked cancels a wake that must not go on: its host fenced, the |
| +// agent shutting down, the entry retired, or its route turned off. wake asks |
| +// at its start and again once it holds a wake slot. |
| +func (a *Service) refuseWakeLocked(e *actEntry, cancel context.CancelFunc) { |
| + // A wake that starts after Shutdown began is cancelled before its |
| + // lease, whatever CARLOS_SWAP says (#292): with swaps off it used to run |
| + // on, and take a lease the exiting agent never gave back. |
| + if a.fences[e.host] != 0 || a.shuttingDown || e.retired { |
| + cancel() |
| + } |
| + // A route a lapse turned off is refused like a fence (plans 4d); a |
| + // move's probe wake still runs, so moves keep working. |
| + if !activeProbe(e) && a.disabled(e.route) { |
| + cancel() |
| + } |
| +} |
| + |
| // wake drives asleep→awake: lease, restore-if-missing, spawn, replicate, |
| // co-spawn the sidecar. It runs on the first requester's goroutine but under |
| // its own generous timeout, detached from that request's context — queued |
| @@ -1978,29 +1998,27 @@ func (a *Service) wake(e *actEntry) { |
| defer cancel() |
| a.mu.Lock() |
| e.wakeCancel = cancel |
| - // Real time, not a.now: it anchors a first wake's real health deadline |
| - // (spawnPlanned, doClaimWake). |
| - e.wakeStart = time.Now() |
| - // A wake that starts after Shutdown began is cancelled before its |
| - // lease, whatever CARLOS_SWAP says (#292): with swaps off it used to run |
| - // on, and take a lease the exiting agent never gave back. |
| - if a.fences[e.host] != 0 || a.shuttingDown || e.retired { |
| - cancel() |
| - } |
| - // A route a lapse turned off is refused like a fence (plans 4d); a |
| - // move's probe wake still runs, so moves keep working. |
| - if !activeProbe(e) && a.disabled(e.route) { |
| - cancel() |
| - } |
| + a.refuseWakeLocked(e, cancel) |
| a.mu.Unlock() |
| wakeStart := a.now() |
| // A slot before anything is taken: the lease, the restore and the spawn |
| - // all wait their turn. A wake cancelled while queued (a fence, shutdown, |
| - // its ceiling) gets no slot and runs doWake on the cancelled context, |
| - // which is how a fenced wake already ends. |
| + // all wait their turn (wakeslots.go). A wake cancelled while queued (a |
| + // fence, shutdown, retirement, its ceiling) gets no slot and runs doWake |
| + // on the cancelled context, which is how a fenced wake already ends. |
| if releaseSlot := a.acquireWakeSlot(ctx, e.host); releaseSlot != nil { |
| defer releaseSlot() |
| } |
| + a.mu.Lock() |
| + // Admitted: from here a retirement leaves the wake to wakeGoesOn's |
| + // checks, as before the queue existed. The refusals are asked again |
| + // because the queue can be long enough for any of them to change. |
| + e.admitted = true |
| + // Real time, not a.now: it anchors a first wake's real health deadline |
| + // (spawnPlanned, doClaimWake). Set at admission, not at the wake's start, |
| + // so time spent queued never shortens a candidate build's health window. |
| + e.wakeStart = time.Now() |
| + a.refuseWakeLocked(e, cancel) |
| + a.mu.Unlock() |
| ctx = carryStatelessPreparation(ctx, e.statelessPrepared) |
| w, err := a.doWake(ctx, e) |
| if w != nil { |
| @@ -5896,6 +5914,13 @@ func (a *Service) RetireExcept(keep map[string]bool) { |
| // never boots the copy it kept. One past its spawn finishes and |
| // is stopped below, as before. |
| e.retired = true |
| + // A wake still queued for a slot holds nothing yet: cancel it, |
| + // so it ends now rather than when a slot opens (#524). Its |
| + // wake goroutine sets wakeCancel before it queues, and one that |
| + // has not got that far reads e.retired itself. |
| + if !e.admitted && e.wakeCancel != nil { |
| + e.wakeCancel() |
| + } |
| waking = append(waking, e) |
| case actStopping: |
| // Already on its way out. |
diff --git a/internal/activator/wakeslots_test.go b/internal/activator/wakeslots_test.go| index 28f0bd231..948484c66 100644 |
| --- a/internal/activator/wakeslots_test.go |
| +++ b/internal/activator/wakeslots_test.go |
| @@ -94,3 +94,106 @@ func TestWakeSlotCountDefault(t *testing.T) { |
| t.Errorf("wakeSlotCount(6) = %d", got) |
| } |
| } |
| + |
| +// queuedBehindOne fills a one-slot service with a gated wake of |
| +// a.example.com, then starts a wake of b.example.com that queues behind it. |
| +// It returns the second request's outcome channel. |
| +func queuedBehindOne(t *testing.T, a *Service, b *fakeBackend) <-chan error { |
| + t.Helper() |
| + b.startGate = make(chan struct{}) |
| + go func() { |
| + if release, err := a.beginRequest(context.Background(), testRoute("a.example.com")); err == nil { |
| + release() |
| + } |
| + }() |
| + waitFor(t, "a.example.com to hold the slot", func() bool { _, _, s := b.counts(); return s == 1 }) |
| + out := make(chan error, 1) |
| + go func() { |
| + release, err := a.beginRequest(context.Background(), testRoute("b.example.com")) |
| + if err == nil { |
| + release() |
| + } |
| + out <- err |
| + }() |
| + waitFor(t, "b.example.com to queue", func() bool { |
| + a.mu.Lock() |
| + defer a.mu.Unlock() |
| + e := a.entries["b.example.com"] |
| + return e != nil && e.wakeCancel != nil |
| + }) |
| + return out |
| +} |
| + |
| +func startedHost(b *fakeBackend, host string) bool { |
| + b.mu.Lock() |
| + defer b.mu.Unlock() |
| + for _, rt := range b.startedRoutes { |
| + if rt.Host == host { |
| + return true |
| + } |
| + } |
| + return false |
| +} |
| + |
| +// A route turned off while its wake queues for a slot takes nothing once |
| +// it is admitted: no lease, no start (Astra R1 P2). |
| +func TestWakeSlotDisabledWhileQueuedStartsNothing(t *testing.T) { |
| + t.Parallel() |
| + a, b := testActivatorSlots(t, 1) |
| + out := queuedBehindOne(t, a, b) |
| + a.SetDisabledFor(disabledFor("b.example.com")) |
| + close(b.startGate) |
| + if err := <-out; err == nil { |
| + t.Fatal("the disabled route's request was served") |
| + } |
| + if acquires, _, _ := b.counts(); acquires != 1 { |
| + t.Fatalf("acquires = %d, want 1 (a.example.com only)", acquires) |
| + } |
| + if startedHost(b, "b.example.com") { |
| + t.Fatal("b.example.com was started after it was turned off") |
| + } |
| +} |
| + |
| +// Retiring a host whose wake is still queued ends that wake straight away, |
| +// while every slot is still held, and it takes nothing (Astra R1 P2). |
| +func TestWakeSlotRetiredWhileQueuedEndsNow(t *testing.T) { |
| + t.Parallel() |
| + a, b := testActivatorSlots(t, 1) |
| + out := queuedBehindOne(t, a, b) |
| + a.RetireExcept(map[string]bool{"a.example.com": true}) |
| + select { |
| + case err := <-out: |
| + if err == nil { |
| + t.Fatal("the retired host's request was served") |
| + } |
| + case <-time.After(5 * time.Second): |
| + t.Fatal("the retired queued wake still waits for a slot") |
| + } |
| + close(b.startGate) |
| + if acquires, _, _ := b.counts(); acquires != 1 { |
| + t.Fatalf("acquires = %d, want 1 (a.example.com only)", acquires) |
| + } |
| + if startedHost(b, "b.example.com") { |
| + t.Fatal("b.example.com was started after it was retired") |
| + } |
| +} |
| + |
| +// A queued wake's health window starts when it is admitted, not when it |
| +// was asked for: time in the queue never shortens it (Astra R1 P2). |
| +func TestWakeSlotHealthWindowStartsAtAdmission(t *testing.T) { |
| + t.Parallel() |
| + a, b := testActivatorSlots(t, 1) |
| + out := queuedBehindOne(t, a, b) |
| + time.Sleep(100 * time.Millisecond) |
| + admittedAfter := time.Now() |
| + close(b.startGate) |
| + if err := <-out; err != nil { |
| + t.Fatalf("b.example.com: %v", err) |
| + } |
| + a.mu.Lock() |
| + got := a.entries["b.example.com"].wakeStart |
| + a.mu.Unlock() |
| + if got.Before(admittedAfter) { |
| + t.Fatalf("wakeStart %v is before admission %v: the queue ate the health window", got, admittedAfter) |
| + } |
| +} |
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv| index 09e41a0a4..7adb2b050 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-chain.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-chain.tsv |
| @@ -69,3 +69,4 @@ plan14-root-reads-region-ha-home-placement.tsv b0304f75d2c5f1b9818d0f282b89c00c0 |
| plan14-root-reads-storedoor-stream-get.tsv 7e30dee4fb52370555ad173512d7f03782f0fbed725a8a6bf4f7e31f52c23668 |
| plan14-root-reads-design-pdf-service.tsv 09ad1d7267b9598c64e89ec0faa7b18839c785c5c63905b398afe681cf9777c6 |
| plan14-root-reads-region-ha-placement-survivor.tsv 09ad1d7267b9598c64e89ec0faa7b18839c785c5c63905b398afe681cf9777c6 |
| +plan14-root-reads-wake-storm-cap.tsv b0fc198c53bb0dacba33a54c3d8bf8fe5ac07d94b76a31b8a69e9411115ecd85 |
diff --git a/internal/provision/testdata/plan14-root-reads-wake-storm-cap.tsv b/internal/provision/testdata/plan14-root-reads-wake-storm-cap.tsv| new file mode 100644 |
| index 000000000..5b56a983b |
| --- /dev/null |
| +++ b/internal/provision/testdata/plan14-root-reads-wake-storm-cap.tsv |
| @@ -0,0 +1,9 @@ |
| +# Census overlay wake-storm-cap, written by census-propose (#369). census-ruling-wake-storm-cap, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-wake-storm-cap.md. |
| +# 1 body, 1 sites, 1 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| +# 1 new dispositions: 0 reads re-frozen at their disposition with the claim, 1 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 other. |
| +@legacy b3f8cb9d012e779847f5abdb3fdf8755aedd60820202af06e602569547043fa1 internal/activator/activator.go Service.refuseWakeLocked legacy accepted-legacy accepted-legacy;rev3=census-ruling-wake-storm-cap;basis=new, the agent as carlos: the refusals Service.wake already made at its start, moved verbatim (fences, shuttingDown, e.retired, then !activeProbe(e) && a.disabled(e.route)) so wake can ask them twice; reads only in-memory state and the route already in hand (whole Route to the disabled hook). Only cancels. whole:Route@515 80a66fed561a404a0c58c6f76d919970ce4f3d73717210c3f7d378609a78e028 |
| +@legacy cee477ff4ffd517760c41e5b47dcfc2f7cb7ebf64563933d906d2ad8ffb24262 internal/activator/activator.go Service.wake legacy accepted-legacy accepted-legacy;rev3=census-ruling-carlos-run;basis=Re-digested at the pre-land merge: the body includes main's own change under census ruling 292, with no further change from this branch. the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body; the stop now carries its reason for a run it interrupts (beginStopLocked's why argument); read sites unchanged, offsets moved;rev3=census-ruling-wake-latency-1;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=logs that timer's breakdown to the journal after a successful wake (w.steps.String(), e.host, w.wakeTook); no read added;rev3=census-ruling-plans-4d-lapse;basis=cancels a wake whose row the turned-off hook names, like a fence, unless it is a move's active probe (plans 4d). One more whole-row read: the row handed to the hook (a.disabled). Only refuses.;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: a refusal before the lease is reported once per change (noteRootfsRefusal) instead of a wake-failure event; the proc, generation and replica are installed through installProcLocked (which puts a resident under its lease watch before the fence); residency notes the outcome (noteResidentWakeLocked); same generation values;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R [pf R3.5]: the wake's context ceiling is wakeCeilingFor(e.route): the old 5 minutes for a binary row, 5 minutes plus runs.MaxTimeout for a rootfs row (room for a release inside the wake); new site +whole:Route (e.route to wakeCeilingFor, which reads Runtime only); no other change;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (branch review R1 P1-1): the wake's context is also cancelled before doWake when RetireExcept has marked the entry retired (e.retired, in memory under a.mu), as it is for a fence or a shutdown. Read sites unchanged (13). Agent, not root; it only refuses more.;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Carry successful hold preparation into its wake, preserve actual mode in the generation and OnWake projection, and project serving version/mode through the narrow registry writer before releasing wake waiters. Final review I1: SetServingMode only for non-worker successful wakes with a nonempty spawned version and either a stateless generation or a mode transition from the route. Ordinary stateful wakes leave rollout status and the wake critical path unchanged.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): adds a.cancelHeldLegsLocked(e, 0) on the failed-wake path before the entry is deleted, and after close(e.ready) on success calls a.noteHeldAdmissible(e.host), the non-blocking held wake callback, outside a.mu. No read added.;rev3=census-ruling-wake-storm-cap;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): waits for a box-wide wake slot (acquireWakeSlot, an in-memory buffered channel) before doWake; the fence/shutdown/retired/disabled refusals move into refuseWakeLocked and are asked again after admission (one fewer direct whole-Route read here: a.disabled(e.route) now runs inside refuseWakeLocked, same value); e.wakeStart is set at admission and e.admitted marks it. Only waits and refuses more; no new read. registry:Socket@8171,registry:Socket@8332,registry:Stateless@10414,registry:Stateless@9666,whole:Route@10416,whole:Route@2921,whole:Route@3012,whole:Route@3069,whole:Route@417,whole:Route@6419,whole:Route@8124,whole:Route@8173,whole:Route@8334,whole:Route@9657,whole:Route@9712 db8062c178ac05479edb5e9765942868e0bd5f214ffcaa9bb044876f4a96521d |
| +internal/activator/activator.go type Service authority B,C,D,F,J4 rev3=PROPOSED-seed; existing activator lifecycle and due-wake state plus owned seed exclusion and incarnation-keyed diagnostics; normal refusal and preparation ordering remain authoritative; PROPOSED-plans-2-box-limits adds the idleFor hook field, which only narrows idle windows;rev3=census-ruling-plans-4c-box-throttle;basis=gains the maxRunFor hook field beside idleFor (plans 4c). No read added.;rev3=census-ruling-plans-4d-lapse;basis=gains the disabledFor hook field beside maxRunFor (plans 4d). No read added.;rev3=census-ruling-remote-instance-metrics;basis=gains tenancySeq, hostTenants and hostMixed, in-memory fields for Tenancies; no read added;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: one more field, markers (markerRetry: an atomic running flag and the last log time) for retryOwedMarkers; no read added; merge of origin/main d7ae1d76: main's fields are kept as main has them (census-ruling-remote-instance-metrics: tenancySeq, hostTenants, hostMixed); this branch's change is the same as above;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: new fields for rootfs admission (rootfsArmed, rootfsSwept), the per-host gate ask and refusal memo, and residency state (lister, backoff, start ceiling, cursor, test seam); no read;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R: one new field, releaseOps (host to the in-memory release record, under a.mu); no read;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W: one new field, leaseNow (a clock seam for a worker start's headroom against the lease deadline, nil is the real clock); no read;rev3=census-ruling-region-ha-p1b2;basis=region HA P1b-2: gains the holder cache and its single-flight state; no read;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (controller ruling after branch review R1, and Paul's R2 ruling): one field, Fleet (activator.FleetWake: the box's fleet state, not on a fleet by default, on a fleet with a known label and a record reader, or on a fleet with an invalid identity), set by the agent before Start and read only by routeCurrentUnderLease. No read in the declaration. Agent, not root.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 7a fix round 1: one field, drainBudget (time.Duration), which New copies from residentDrainBudget and a rootfs entry's lease watch reads in its place, so a test's change of the package var never races a watch goroutine; declaration only, reads nothing; merge of origin/main 6f1f6ca6: main's one field, Fleet (activator.FleetWake), is kept as main has it (census-ruling-managed-fleets-1b); this branch's change is the same as above;rev3=census-ruling-region-ha-p1b3a;basis=Add bounded placement peer and diagnostic state and the over-capacity callback; no read in this declaration and no new root authority.;rev3=census-ruling-stateless-replicas-1;basis=Add coordinator, existing-record observation callback and per-host preparation locks; no read in the declaration. Task 3a: Add optional canonical storage-selection and durable deploy-ID callbacks; declaration only, no read or authority in these fields.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): adds the heldLegs map to actEntry (legs by id, under a.mu) and heldWakeHook (atomic pointer to a callback) and heldLegSeq (atomic counter) to Service. State only, in memory; no read of tenant, app or box-agent-writable input.;rev3=census-ruling-wake-storm-cap;basis=the agent as carlos: one field, wakeSlots (chan struct{}, the wake semaphore made by New from Config.WakeSlots, default 4); declaration only, no read. f6d09bc7a18c2eb32a36168a9153047495dc2bcf18fb35a5b978b98d7496ded1 |
| +internal/activator/activator.go Service.refuseWakeLocked legacy accepted-legacy accepted-legacy;rev3=census-ruling-wake-storm-cap;basis=new, the agent as carlos: the refusals Service.wake already made at its start, moved verbatim (fences, shuttingDown, e.retired, then !activeProbe(e) && a.disabled(e.route)) so wake can ask them twice; reads only in-memory state and the route already in hand (whole Route to the disabled hook). Only cancels. whole:Route@515 80a66fed561a404a0c58c6f76d919970ce4f3d73717210c3f7d378609a78e028 |
| +internal/activator/activator.go Service.wake legacy accepted-legacy accepted-legacy;rev3=census-ruling-carlos-run;basis=Re-digested at the pre-land merge: the body includes main's own change under census ruling 292, with no further change from this branch. the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body; the stop now carries its reason for a run it interrupts (beginStopLocked's why argument); read sites unchanged, offsets moved;rev3=census-ruling-wake-latency-1;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=logs that timer's breakdown to the journal after a successful wake (w.steps.String(), e.host, w.wakeTook); no read added;rev3=census-ruling-plans-4d-lapse;basis=cancels a wake whose row the turned-off hook names, like a fence, unless it is a move's active probe (plans 4d). One more whole-row read: the row handed to the hook (a.disabled). Only refuses.;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: a refusal before the lease is reported once per change (noteRootfsRefusal) instead of a wake-failure event; the proc, generation and replica are installed through installProcLocked (which puts a resident under its lease watch before the fence); residency notes the outcome (noteResidentWakeLocked); same generation values;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R [pf R3.5]: the wake's context ceiling is wakeCeilingFor(e.route): the old 5 minutes for a binary row, 5 minutes plus runs.MaxTimeout for a rootfs row (room for a release inside the wake); new site +whole:Route (e.route to wakeCeilingFor, which reads Runtime only); no other change;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (branch review R1 P1-1): the wake's context is also cancelled before doWake when RetireExcept has marked the entry retired (e.retired, in memory under a.mu), as it is for a fence or a shutdown. Read sites unchanged (13). Agent, not root; it only refuses more.;rev3=census-ruling-stateless-replicas-1;basis=Task 3a: Carry successful hold preparation into its wake, preserve actual mode in the generation and OnWake projection, and project serving version/mode through the narrow registry writer before releasing wake waiters. Final review I1: SetServingMode only for non-worker successful wakes with a nonempty spawned version and either a stateless generation or a mode transition from the route. Ordinary stateful wakes leave rollout status and the wake critical path unchanged.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): adds a.cancelHeldLegsLocked(e, 0) on the failed-wake path before the entry is deleted, and after close(e.ready) on success calls a.noteHeldAdmissible(e.host), the non-blocking held wake callback, outside a.mu. No read added.;rev3=census-ruling-wake-storm-cap;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): waits for a box-wide wake slot (acquireWakeSlot, an in-memory buffered channel) before doWake; the fence/shutdown/retired/disabled refusals move into refuseWakeLocked and are asked again after admission (one fewer direct whole-Route read here: a.disabled(e.route) now runs inside refuseWakeLocked, same value); e.wakeStart is set at admission and e.admitted marks it. Only waits and refuses more; no new read. registry:Socket@8171,registry:Socket@8332,registry:Stateless@10414,registry:Stateless@9666,whole:Route@10416,whole:Route@2921,whole:Route@3012,whole:Route@3069,whole:Route@417,whole:Route@6419,whole:Route@8124,whole:Route@8173,whole:Route@8334,whole:Route@9657,whole:Route@9712 db8062c178ac05479edb5e9765942868e0bd5f214ffcaa9bb044876f4a96521d |
| +@coverage internal/activator 75e3d5e5cca5c68250f77305f24477a6d2a2d4591277cf7c97aff046a3496eb9 |