headscale/hscontrol/util
Kristoffer Dalby 57070680a5 mapper/batcher: restructure internals for correctness
Move per-node pending changes from a shared xsync.Map on the batcher
into multiChannelNodeConn, protected by a dedicated mutex. The new
appendPending/drainPending methods provide atomic append and drain
operations, eliminating data races in addToBatch and
processBatchedChanges.

Add sync.Once to multiChannelNodeConn.close() to make it idempotent,
preventing panics from concurrent close calls on the same channel.

Add started atomic.Bool to guard Start() against being called
multiple times, preventing orphaned goroutines.

Add comprehensive concurrency tests validating these changes.
2026-03-14 02:52:28 -07:00
..
zlog hscontrol/util/zlog/zf: add tag, authkey, and route constants 2026-02-06 07:40:29 +01:00
addr.go all: fix golangci-lint issues (#3064) 2026-02-06 21:45:32 +01:00
addr_test.go all: fix golangci-lint issues (#3064) 2026-02-06 21:45:32 +01:00
const.go Split code into modules 2023-05-26 12:24:50 +02:00
dns.go all: fix golangci-lint issues (#3064) 2026-02-06 21:45:32 +01:00
dns_test.go all: fix golangci-lint issues (#3064) 2026-02-06 21:45:32 +01:00
file.go all: fix golangci-lint issues (#3064) 2026-02-06 21:45:32 +01:00
key.go errors: rewrite errors to follow go best practices 2026-02-06 07:40:29 +01:00
log.go all: fix golangci-lint issues (#3064) 2026-02-06 21:45:32 +01:00
net.go integration: replace time.Sleep with assert.EventuallyWithT (#2680) 2025-07-10 23:38:55 +02:00
norace.go mapper/batcher: restructure internals for correctness 2026-03-14 02:52:28 -07:00
prompt.go all: fix golangci-lint issues (#3064) 2026-02-06 21:45:32 +01:00
prompt_test.go all: fix golangci-lint issues (#3064) 2026-02-06 21:45:32 +01:00
race.go mapper/batcher: restructure internals for correctness 2026-03-14 02:52:28 -07:00
string.go all: fix golangci-lint issues (#3064) 2026-02-06 21:45:32 +01:00
string_test.go allow users to be defined with @ in v1 (#2495) 2025-03-30 11:19:05 +00:00
test.go all: upgrade to Go 1.26rc2 and modernize codebase 2026-02-08 12:35:23 +01:00
util.go auth: generalise auth flow and introduce AuthVerdict 2026-02-25 21:28:05 +01:00
util_test.go auth: generalise auth flow and introduce AuthVerdict 2026-02-25 21:28:05 +01:00