frp/server
fatedier c7ac12ea0f
server/group: refactor with shared abstractions and fix concurrency issues (#5222)
* server/group: refactor group package with shared abstractions and fix concurrency issues

Extract common patterns into reusable components:
- groupRegistry[G]: generic concurrent map for group lifecycle management
- baseGroup: shared plumbing for listener-based groups (TCP, HTTPS, TCPMux)
- Listener: unified virtual listener replacing 3 identical implementations

Fix concurrency issues:
- Stale-pointer race: isCurrent check + errGroupStale + controller retry loops
- Worker generation safety: pass realLn and acceptCh as params instead of reading mutable fields
- Connection leak: close conn on worker panic recovery path
- ABBA deadlock in HTTP UnRegister: consistent lock ordering (group.mu -> registry.mu)
- Round-robin overflow in HTTPGroup: use unsigned modulo

Add unit tests (17 tests) for registry, listener, and baseGroup.
Add TCPMux group load balancing e2e test.

* server/group: replace tautological assertion with require.NotPanics

* server/group: remove blank line between doc comment and type declaration
2026-03-08 18:57:21 +08:00
..
controller https: add load balancing group support (#5032) 2025-10-28 17:37:18 +08:00
group server/group: refactor with shared abstractions and fix concurrency issues (#5222) 2026-03-08 18:57:21 +08:00
http refactor: restructure API packages into client/http and server/http with typed proxy/visitor models (#5193) 2026-03-04 17:38:43 +08:00
metrics web/frps: add detailed client and proxy views with enhanced tracking (#5144) 2026-01-31 02:18:35 +08:00
ports support yaml/json/toml configuration format, make ini deprecated (#3599) 2023-09-06 10:18:02 +08:00
proxy refactor: fix modernize lint issues (#5215) 2026-03-07 23:10:19 +08:00
registry add persistent proxy/visitor store with CRUD API and web UI (#5188) 2026-03-02 01:09:59 +08:00
visitor use std slices package (#4008) 2024-02-20 12:01:41 +08:00
api_router.go refactor: restructure API packages into client/http and server/http with typed proxy/visitor models (#5193) 2026-03-04 17:38:43 +08:00
control.go server/control: deduplicate close-proxy logic and UserInfo construction (#5218) 2026-03-08 00:02:14 +08:00
service.go server: introduce SessionContext to encapsulate NewControl parameters (#5217) 2026-03-07 20:17:00 +08:00