mirror of
https://github.com/tailscale/tailscale.git
synced 2026-06-23 21:08:33 +08:00
The compare-metrics-stats subtest reset two independent counting systems (physical connection counters and expvar.Int user metrics) non-atomically. Background WireGuard keepalives arriving between the resets could increment one system but not the other, causing off-by-one packet/byte mismatches in either direction. Replace the reset-then-compare pattern with snapshot-and-delta: snapshot both systems before pings, snapshot again after, and compare the deltas. This eliminates the non-atomic reset window entirely. As a belt-and-suspenders safety net, tolerate a difference of exactly one packet (and corresponding bytes) from a stray keepalive that could still arrive in the narrow window between the two snapshots. flakestress passes with ~5900 runs (~2800 without -race, ~3100 with -race) but it also passed previously too. This is an annoying one to repro. Fixes #11762 Change-Id: I3447ad67e71c8146e85eed38b7a665033ef9e284 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com> |
||
|---|---|---|
| .. | ||
| bench | ||
| filter | ||
| magicsock | ||
| netlog | ||
| netstack | ||
| router | ||
| wgcfg | ||
| wgint | ||
| wglog | ||
| winnet | ||
| mem_ios.go | ||
| pendopen_omit.go | ||
| pendopen.go | ||
| userspace_ext_test.go | ||
| userspace_test.go | ||
| userspace.go | ||
| watchdog_omit.go | ||
| watchdog_test.go | ||
| watchdog.go | ||
| wgengine.go | ||