feat(xray): split slots into extra Xray processes only on global conflicts #8

Merged
forgejo-admin merged 1 commit from feat/split-xray-on-global-conflict into main 2026-10-25 19:32:36 +00:00

Slots whose native profiles (or local routing DNS) disagree on
process-global Xray sections (DNS, policy, routing settings) used to
fail config generation for the whole engine. Now build_xray_configs
keeps the single shared process whenever possible and, only on
SharedConflict, greedily groups slots into the fewest compatible
groups, one Xray process each (xray.json, xray-1.json, ...).

The engine validates every candidate before touching running
processes, removes stale xray-N.json files, and treats any dead group
process as degraded. A slot that conflicts with itself stays an error.

Tests: SHLUZ_TEST_XRAY=<xray 26.9.9> cargo test -p shluz-xray-engine green incl. native two-slot test (conflict → 2 processes, both slots route correctly, merge back → 1 process, xray-1.json removed). New unit test for grouping. Workspace: only the 2 pre-existing shluzd::subscriptions::fetch timeouts fail (also on main).

Note: merge #7 first, otherwise arch-build fails on this merge commit again.

Slots whose native profiles (or local routing DNS) disagree on process-global Xray sections (DNS, policy, routing settings) used to fail config generation for the whole engine. Now build_xray_configs keeps the single shared process whenever possible and, only on SharedConflict, greedily groups slots into the fewest compatible groups, one Xray process each (xray.json, xray-1.json, ...). The engine validates every candidate before touching running processes, removes stale xray-N.json files, and treats any dead group process as degraded. A slot that conflicts with itself stays an error. Tests: `SHLUZ_TEST_XRAY=<xray 26.9.9> cargo test -p shluz-xray-engine` green incl. native two-slot test (conflict → 2 processes, both slots route correctly, merge back → 1 process, xray-1.json removed). New unit test for grouping. Workspace: only the 2 pre-existing `shluzd::subscriptions::fetch` timeouts fail (also on main). Note: merge #7 first, otherwise arch-build fails on this merge commit again.
Slots whose native profiles (or local routing DNS) disagree on
process-global Xray sections (DNS, policy, routing settings) used to
fail config generation for the whole engine. Now build_xray_configs
keeps the single shared process whenever possible and, only on
SharedConflict, greedily groups slots into the fewest compatible
groups, one Xray process each (xray.json, xray-1.json, ...).

The engine validates every candidate before touching running
processes, removes stale xray-N.json files, and treats any dead group
process as degraded. A slot that conflicts with itself stays an error.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
forgejo-admin/shluz!8
No description provided.