3x-ui/internal/xray
n0ctal abffa8f6c9
fix(xray): guard process lifecycle fields against concurrent access (#5395)
The process cmd, done and exitErr fields were written by Start/startCommand and
the waitForCommand goroutine while IsRunning/GetErr/GetResult/Stop read them
concurrently from other goroutines (the status endpoint and the check-xray
job) — a data race. Guard them with a RWMutex: writers take the write lock;
readers snapshot under the read lock and run any blocking syscall
(Wait/Signal/Kill) on the local copy without holding it. IsRunning now uses the
done channel as the exit signal instead of reading cmd.ProcessState, which
races with cmd.Wait. Adds a -race regression test.
2026-06-20 00:37:03 +02:00
..
api.go feat(online): use xray online-stats API for onlines and access-log-free IP limit 2026-06-11 19:42:03 +02:00
api_e2e_test.go feat(online): use xray online-stats API for onlines and access-log-free IP limit 2026-06-11 19:42:03 +02:00
api_test.go refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
client_traffic.go perf(db): index group_name and client_traffics hot columns (#5268) 2026-06-14 22:54:59 +02:00
config.go feat: apply inbound/outbound/routing changes live via Xray gRPC API 2026-06-10 23:01:33 +02:00
config_test.go refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
hot_diff.go feat: apply inbound/outbound/routing changes live via Xray gRPC API 2026-06-10 23:01:33 +02:00
hot_diff_test.go feat: apply inbound/outbound/routing changes live via Xray gRPC API 2026-06-10 23:01:33 +02:00
inbound.go refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
inbound_test.go refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
log_writer.go refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
mutation_audit_test.go refactor(frontend): move form-item hints from extra to tooltip 2026-06-17 17:24:16 +02:00
online_test.go feat(online): use xray online-stats API for onlines and access-log-free IP limit 2026-06-11 19:42:03 +02:00
process.go fix(xray): guard process lifecycle fields against concurrent access (#5395) 2026-06-20 00:37:03 +02:00
process_other.go refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
process_race_test.go fix(xray): guard process lifecycle fields against concurrent access (#5395) 2026-06-20 00:37:03 +02:00
process_test.go refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
process_windows.go refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
traffic.go refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00