sfu: skip pacer allocation assertion under the race detector (#4874)

sync.Pool drops a quarter of returned items when built with -race, so the
pooled send path averages about one allocation per packet in CI and the
zero-allocation assertion flips between passing and failing. Keep the
extension checks and skip only the allocation count under race.

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Raja Subramanian
2026-09-16 02:59:09 +05:30
committed by GitHub
co-authored by Claude Fable 5.1
parent 61a31d31ff
commit 482fbe2cf7
3 changed files with 18 additions and 1 deletions
+6
View File
@@ -0,0 +1,6 @@
//go:build !race
package utils
// RaceEnabled reports whether the binary was built with the race detector.
const RaceEnabled = false
+8
View File
@@ -0,0 +1,8 @@
//go:build race
package utils
// RaceEnabled reports whether the binary was built with the race detector.
// sync.Pool drops a quarter of returned items under it, so allocation counts
// on pooled paths are not meaningful.
const RaceEnabled = true