From 469758837a768db19e1d5c325a37c1fbd377ad5b Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Sat, 31 Oct 2026 10:44:59 +0100 Subject: [PATCH] fix(node): reconcile the local core after node disables without forcing it The node traffic sync restarted the master's own Xray with force after any tick that disabled clients, so a node reporting a fresh over-quota client every few seconds dropped every local user's connections each time, though nodes serve none of them. Use the non-forced restart the local traffic job uses: an unchanged local config keeps the core, and a change still restarts when restartXrayOnClientDisable asks for it. Reaching RestartXray needs a running core, so no unit test covers this. --- internal/web/job/node_traffic_sync_job.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/web/job/node_traffic_sync_job.go b/internal/web/job/node_traffic_sync_job.go index aaa3b22b0..b81938c88 100644 --- a/internal/web/job/node_traffic_sync_job.go +++ b/internal/web/job/node_traffic_sync_job.go @@ -140,7 +140,9 @@ func (j *NodeTrafficSyncJob) Run() { } if clientsDisabled { if restartOnDisable, settingErr := j.settingService.GetRestartXrayOnClientDisable(); settingErr == nil && restartOnDisable { - if err := j.xrayService.RestartXray(true); err != nil { + // Not forced: a client only nodes serve leaves the local config unchanged, and a node + // deciding when this tick disables clients must not decide when local users drop. + if err := j.xrayService.RestartXray(false); err != nil { logger.Warning("node traffic sync: restart xray after disabling clients failed:", err) j.xrayService.SetToNeedRestart() }