Artifact b7f7fb2a407528afb0d83451d23fee30a89e55ac88a0546758082ab7d4288c87:
- File
hub/assert.go
-
2026-05-19 18:54:41
— part of check-in
[8a18ec9ebe]
on branch fix/hub-stop-servehttp-race-tigerstyle
— fix(hub): single-owner httpServer construction in NewHub (closes 187)
TigerStyle: eliminate the shared mutable state instead of guarding it.
Move mux + http.Server construction from ServeHTTP into NewHub. After NewHub returns, h.httpServer and h.httpListener are immutable for the hubs lifetime — single writer (NewHub), many readers (ServeHTTP, Stop). No mutex, no atomic, no sync.Once required: the race is gone by construction.
Add a hub package-private assert helper and positive invariants at entry to ServeHTTP and Stop, surfacing programmer-bugs loudly instead of silently UB-ing on a nil httpServer.
Fixes the 3 data races in TestCrossSessionAutosync and the 3 in TestScope_Project_ConcurrentCommits under -race; hub package suite green at -race -count=3. (user: 41898282+github-actions[bot]@users.noreply.github.com, size: 581) [annotate] [blame] [check-ins using]
-
2026-05-19 18:59:22
— part of check-in
[3b6306fdc2]
on branch main
— fix(hub): single-owner httpServer construction in NewHub (closes 187) (#188)
TigerStyle: eliminate the shared mutable state instead of guarding it.
Move mux + http.Server construction from ServeHTTP into NewHub. After NewHub returns, h.httpServer and h.httpListener are immutable for the hubs lifetime — single writer (NewHub), many readers (ServeHTTP, Stop). No mutex, no atomic, no sync.Once required: the race is gone by construction.
Add a hub package-private assert helper and positive invariants at entry to ServeHTTP and Stop, surfacing programmer-bugs loudly instead of silently UB-ing on a nil httpServer.
Fixes the 3 data races in TestCrossSessionAutosync and the 3 in TestScope_Project_ConcurrentCommits under -race; hub package suite green at -race -count=3.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> (user: [email protected], size: 581) [annotate] [blame] [check-ins using]
-
2026-05-19 18:54:41
— part of check-in
[8a18ec9ebe]
on branch fix/hub-stop-servehttp-race-tigerstyle
— fix(hub): single-owner httpServer construction in NewHub (closes 187)