Repository navigation
redteam: Phase 4 part 4 — churn/cgroup suite (rt-4-6, rt-11-8, rt-4-8) + task 4.11 wrap-up - #372
Conversation
…-8, rt-4-8), task 4.11 wrap-up Three scenarios close Phase 4: - rt-4-6 namespace/socket churn storm (16/16, 20261130T041837-848ebbe00-1287288): 149 netns add+del cycles in 240 s (one launch/s, each container 2500 LISTEN + 2500 client sockets, dead ~2.5 s, --rm), poll_sockets 237->7875 mid-storm, CPU 111-114% of 4 vCPUs, victim records flowing MID-storm, reconcile_incomplete_total 0->0. Post-storm convergence waits (not fixed sleeps — measured: in-flight goroutines take ~2 min to drain): go_goroutines 51->51, process_open_fds 53->53, poll_sockets back to 245 (a leaked dead netns counts 1M unknown sockets in the gauge, so baseline-level = the map drained). No fd leak, no goroutine leak, no restart. The 24 h variant is env-gated (RT_CHURN_SECS=86400), never a matrix default. - rt-11-8 self-churn + reconcile amplification (18/18, 20261130T042718-848ebbe00-1464077): 20 docker restart cycles ~4.5 s apart, each re-packing 10000 sockfill loopback pairs (poll_sockets 241->20244): mid-storm victim coverage lag 0 s (the row's verdict criterion), reconcile complete p99 0.00032 s (the 1 s budget is 3000x above), add_rate=0, no leak, no restart. - rt-4-8 poll amplification under a cpu quota (16/16, 20261130T045657-848ebbe00-1525702): the refocused cgroup-cap variant (XTCP2_CPUS=2, the deploy axis): an admin sets the 1 s floor and runs TriggerPollBurst 120x1s — record rate 116->491 rec/s (4.2x, the full-dump-per-poll cost) while daemon CPU stays 130.9%/132.0% vs the 210% quota bound, RSS 24453->27002 kB, no OOM-kill, metrics answers through the burst, rate settles post-burst. The nuance: the burst multiplies RECORDS not CPU at this population; the record-volume residual is #342's family. Prod guidance: pin XTCP2_CPUS — the default deploy is unlimited. - task 4.11 observability wrap-up: of the four gauges the suite needs, three already exist and are now asserted in-scenario (process_open_fds, go_goroutines, Poller/pollToDoneDuration + PollTimeout, the delivery-error counters); per-namespace coverage lag does not exist (aggregate-only) — filed #371. NEW measured gap filed as #370: netns add/del is invisible in metrics — the per-poll reconcile (the ACTUAL discovery path, reconcileBeforePoll) returns its add/del deltas uncounted (poller.go reconcileThenPoll logs at debug>10 and drops them), and mapReconciler's stores/dels only fire on the 6 h background ticker, which never ticks in a 4-min run. Findings rows, plan VERIFIED cells, and the implementation DoD updated. Gates: redteam-lint 0 findings, lint-baseline exit 0.
…rt race, not a product change) The 38-scenario full-matrix regression failed exactly one assertion (rt-11-5 ok 14, 'no new Write errors during the second stall'): cycle 2's fixed 18 s window demanded a Write-error rise, but cycle 1's error burst can leave the queue worker in a full-jitter backoff window where NO write is attempted, so nothing errors — measured: Write/error flat 9->9, dark the whole window (0 lines/6s), polls continuing 78->82, delivery healed on de-poison with no restart. Every MITIGATED verdict criterion held; the solo re-run errored 11->13 in-window. No product code changed since #361 (verified: destinations_tcp/queue untouched between df22997 and this branch). The fix, mirroring cycle 1's shape treatment: - Widen first: poll Write/error up to 60 s more while the poison is still active, so the deadline gets its best chance to show. - A third ok shape when the counter stays flat: the backoff shape, gated on the rest of the block's evidence — polls kept issuing (asserted in the same branch), and delivery heals on de-poison (ok 17) with no restart. The #345 freeze can do neither, so a flat Write/error with those two is provably the bounded backoff window, not a silent blind. A real freeze still fails ok 14 (polls frozen -> P2B == P2A -> not_ok) and ok 17 (no heal). Re-runs: 18/18 PASS (20261130T105600-d60b20007-3991909 — in-window errors, 11->13; 20261130T111556-d60b20007-4167647 — the fix on the branch head).
|
Full-matrix regression: 38 scenarios, 37 PASS + 1 assert race fixed + re-verified solo. The one failure was rt-11-5 ok 14 (cycle 2, "no new Write errors during the second stall"): cycle 1's error burst can leave the queue worker in a full-jitter backoff window where no write is attempted, so nothing errors — measured: Write/error flat 9→9, dark the whole window (0 lines/6s), polls continuing 78→82, delivery healed on de-poison with no restart. Every MITIGATED verdict criterion held; the solo re-run errored 11→13 in-window. No product code changed since #361 (verified: Fixed in Re-verified: 18/18 PASS twice ( |
The review found four asserts that pass for the wrong reason or check something other than what they claim; no product code is at fault. 1. rt-11-8 msum always returned 0: the awk program sits inside a double-quoted string and carried \\ (escaped twice), so $1 expanded locally to the series substring — awk got a syntax error that '|| echo 0' then hid as a permanent 0. The add_rate and reconcile_incomplete checks could not fail; their zeros in run 1 were never measured. Fixed to \\'s single escape (rt-4-6's copy was correct); the helpers now document the trap. 2. rt-4-6 read the wrong series for reconcile/start: mval 'variable="start"' matches NINE series; sorted first is Deserialize/start (the envelope-deserialization counter, ~60/s — the quoted +14730 over the storm), NOT reconcile/start (~1/poll). Live-scrape confirmed: Deserialize/start 227550, reconcile/start 10828. Fixed to the full label set (function="reconcile",type="count",variable="start"); the reconcile-delta bound is now derived from the expected poll count, not the cycle count. #370's quoted number gets a correction comment. 3. The 'netns map drained' claim was wrong twice: each map entry holds a sockstat fd that KEEPS its namespace alive (sockstat.go:14-18), so a leaked entry keeps reading ~0 sockets — never 'unknown'; and -maxRecordsPerNetns is 262144 (1<<18), not 1M. The FD convergence check is the drain proof (a leaked entry = one leaked fd); the socket gauge now claims only 'no residual sockets'. Fixed in both churn scenarios + findings + plan + implementation. 4. rt-4-8's 'post-burst' sample was mid-burst: the poll-burst RPC returns immediately and SetPollFrequency does not stop a running burst (pollBurstRunner pokes on its own cadence for -count seconds), so the sample ~40-52 s in sat at the restored 2 s ticker + 1 s burst = 1.5 polls/s = 3x the 0.5/s baseline, exactly at the old 3x assert bound (flaky). Now waits for the daemon's own poke counter (pollBurstRunner poke+pokeDropped >= 120 — poke alone can stall when a poke is subsumed) before sampling, and the settle bound tightens to 2x. The mid-burst amplification attribution is corrected: ~half the 4.2x is the 1 s-floor ticker itself, half the burst (the daemon runs both). Also: the stores/dels=0 leg of the #370 check was a pass-on-bug — the 24 h variant sees the 6 h ticker fire and the day #370 lands the deltas become counted, so it is informational (two shapes) now, and 'duration-agnostic' no longer overclaims. rt-4-8's quota bounds derive from XTCP2_CPUS instead of hard-coding 2 CPUs / 210%. rt-11-5's comment cites the real matrix run ID (20261130T064858). All three churn scenarios register an EXIT trap so a set -e death tears down the drivers/sockfills instead of leaving them running on the VM (rt-4-8 restores the poll cadence). Gates: shellcheck + bash -n clean on all four; lint + lint-baseline re-run below with the re-verification.
…e of 120) The driver cadence is 1.6-2.4 s per cycle (docker rm -f + docker run -d + sleep 1, each container packing 2500 LISTEN + 2500 dials), so 240 s yields 101-149 cycles — the /2 bound (120) failed a healthy run (101 cycles, every product assert green, the storm itself real). /3 (80). The expected-polls formula tightens to storm+60s (measured: 131 polls over the window — the +240s settle slack over-estimated it).
…, rt-11-8 18/18, rt-4-8 17/17)
|
Thank you — all eight points confirmed against the code and fixed in 1. rt-11-8 msum always 0 — confirmed and fixed. The awk program sat inside a double-quoted string carrying 2. rt-4-6 read Deserialize/start, not reconcile/start — confirmed live and fixed. A live scrape shows NINE series with 3. The "map drained via poll_sockets" claim was wrong twice — corrected. The sockstat fd keeps its namespace alive (sockstat.go:14-18), so a leaked entry keeps reading ~0 sockets and never reads "unknown"; and 4. rt-4-8's "post-burst" sample was mid-burst — fixed with the daemon's own completion view. 5. stores=0 && dels=0 was a pass-on-bug — made informational. A 24 h soak sees the 6 h ticker fire (stores/dels > 0) and the day #370 lands the per-poll deltas become counted — neither is a failure of this row. The check is now two informational shapes, and "all asserts duration-agnostic" is corrected to "ratio/bound-based + the stores/dels check informational". 6. rt-4-8's hard-coded 2-CPU bounds — worked out from XTCP2_CPUS. 7. rt-11-5's placeholder run ID — now cites the real matrix run ( 8. Cleanup traps added to all three churn scenarios (and rt-4-8 restores the poll cadence): a Also from the re-runs: rt-4-6's cycle-count gate was itself miscalibrated — the driver cadence is 1.6–2.4 s/cycle (docker rm/run + sleep 1, each container packing 2500 LISTEN + 2500 dials), so 240 s yields 101–149 cycles and the old ≥120 bound failed a healthy run (101 cycles, every product assert green); now /3. Re-verified 16/16 ( Gates on the merged tree (origin/main at |
|
Full-matrix regression: 38 scenarios, 0 failed — all green on the branch head Every scenario PASS: rt-4-6 16/16, rt-11-8 18/18, rt-4-8 17/17, rt-11-5 MITIGATED 18/18 (the backoff shape from the first matrix run held — cycle 2 errored in-window this time), and the 34 previously-verified rows unchanged. For the review record, the four script bugs are all fixed and re-measured on this exact tree: rt-11-8's msum now sums real values (add_rate=0, incomplete=0 as measurements), rt-4-6 reads |
…T000311-8a2d69078)
Closes Phase 4: the three remaining rows plus the observability-enabler wrap-up. All three scenarios pass in one run each; two product issues filed from the measurements (#370, #371).
rt-4-6 namespace/socket churn storm — BLOCKED (16/16,
20261130T041837-848ebbe00-1287288)149 netns add+del cycles in 240 s (one launch/s; each container: tcp-stress
bothwith-close— 2500 LISTEN + 2500 client sockets, dead ~2.5 s,--rm):reconcile_incomplete_total0→0, no restartRT_CHURN_SECS=86400), never a matrix default; all asserts duration-agnosticrt-11-8 self-churn + reconcile amplification — BLOCKED (18/18,
20261130T042718-848ebbe00-1464077)20
docker restart -t 0 rt-attackercycles ~4.5 s apart, each re-packing 10000 sockfill loopback pairs (poll_sockets 241→20244):completep99 0.00032 s (the 1 sreconcileTimeoutbudget is 3000× above — the scan is over ~8 netns; the restart churn is noise to it)netns_dropped{add_rate}=0,reconcile_incomplete=0, no restartrt-4-8 poll amplification under a CPU quota — BLOCKED (16/16,
20261130T045657-848ebbe00-1525702)The premortem-refocused cgroup variant (the 100-container population was arithmetic — rt-3-3 measured the mechanism; this row's untested clause was cgroup protection).
XTCP2_CPUS=2(the deploy axis), admin vantage (TriggerPollBurst is an admin RPC):-countbounds it). Prod guidance: pinXTCP2_CPUS— the default deploy is unlimited.Task 4.11 (observability enabler) — wrap-up
Of the four gauges the suite needs, three already exist and are now asserted in-scenario:
process_open_fds,go_goroutines,Poller/pollToDoneDuration+PollTimeout, and the delivery-error counters. Two issues filed:reconcileBeforePoll) returns its deltas uncounted (reconcileThenPolllogs at debug>10 and drops them), andmapReconcilerstores/dels only fire on the 6 h background ticker (never in a 4-min run — both stayed 0 through 149 churn cycles). rt-4-6 asserts this gap explicitly.victim_lag_s); no netns label exists to alert on a single degraded namespace.Evidence
Gates:
nix run .#redteam-lint0 findings;nix build .#checks.x86_64-linux.lint-baselineexit 0. Scenario runs: rt-4-6 16/16, rt-11-8 18/18, rt-4-6 run 1: 14/15 (the +15 goroutines at the 30 s settle was the measured transient that motivated the convergence waits), run 2: 16/16, and a review-driven re-verification after the four script fixes: 16/16. The 36-scenario full-matrix regression runs before merge.