Files
Pulse/internal/monitoring
rcourtman a85c38ee05 Share the per-call allocation guard with backup polling reads
TestBackupPollingReadsDoNotCopyUnrelatedInventory took the minimum of
four testing.AllocsPerRun(5) averages and held it to +4 objects, the
pattern that made the snapshot guard flaky under -race. Its callbacks
allocate only 8 to 61 objects, so race noise is smaller, but it still
reached +3 against the +4 bound on pulse-dev and failed main once on
10 November (58 -> 64 in pbs-cache).

Move the per-call measurement into one helper in this file and use it
for both guards: each call measured alone, with one P, the collector
paused and no memory limit, judged by minimum and median bytes, median
objects, and peak bytes. The backup guard keeps its full-copy and
intermittent-copy controls; the intermittent one now copies on a single
measured call instead of relying on AllocsPerRun's sample layout.

A copy of the state costs the large fixture about 1.3 MB and 4000
objects per call. Over 200 race runs the fixtures differed by at most
288 bytes and 4 objects, so the bounds are 4 KiB and 16 objects on
every call and 16 KiB on the peak.

On pulse-dev with CPU load both guards passed 200 of 200 runs each
under -race and 100 of 100 without it. The backup guard failed every
run with each original full-state read put back into the PBS cache,
storage and snapshot callbacks, and with a state copy on every seventh
PBS cache call.
2026-11-14 13:55:12 +00:00
..
2026-07-11 18:25:17 +01:00
…
…