headscale/hscontrol/mapper
Kristoffer Dalby da33795e79 mapper/batcher: fix race conditions in cleanup and lookups
Replace the two-phase Load-check-Delete in cleanupOfflineNodes with
xsync.Map.Compute() for atomic check-and-delete. This prevents the
TOCTOU race where a node reconnects between the hasActiveConnections
check and the Delete call.

Add nil guards on all b.nodes.Load() and b.nodes.Range() call sites
to prevent nil pointer panics from concurrent cleanup races.
2026-03-14 02:52:28 -07:00
..
batcher.go mapper/batcher: restructure internals for correctness 2026-03-14 02:52:28 -07:00
batcher_bench_test.go mapper/batcher: restructure internals for correctness 2026-03-14 02:52:28 -07:00
batcher_concurrency_test.go mapper/batcher: fix race conditions in cleanup and lookups 2026-03-14 02:52:28 -07:00
batcher_lockfree.go mapper/batcher: fix race conditions in cleanup and lookups 2026-03-14 02:52:28 -07:00
batcher_test.go mapper/batcher: restructure internals for correctness 2026-03-14 02:52:28 -07:00
batcher_unit_test.go mapper/batcher: add unit tests and benchmarks 2026-03-14 02:52:28 -07:00
builder.go all: fix golangci-lint issues (#3064) 2026-02-06 21:45:32 +01:00
builder_test.go all: fix golangci-lint issues (#3064) 2026-02-06 21:45:32 +01:00
mapper.go all: fix golangci-lint issues (#3064) 2026-02-06 21:45:32 +01:00
mapper_test.go all: upgrade to Go 1.26rc2 and modernize codebase 2026-02-08 12:35:23 +01:00
tail_test.go all: upgrade to Go 1.26rc2 and modernize codebase 2026-02-08 12:35:23 +01:00