3x-ui/internal/web/job
Sanaei 63b46cd612
perf(clients): apply a multi-inbound client create concurrently
Creating or attaching a client across N inbounds called AddInboundClient
once per inbound, strictly one after another. When those inbounds live on
different nodes each call is a full node round-trip bounded by the 10s
remote timeout, so the request cost the SUM of every node's latency: two
nodes felt instant, three took ~13s and timed out bot callers, which is
how it surfaced as "two out of four account creations fail".

Split the per-inbound preparation from the apply. Preparation stays
ordered and single-threaded because fillProtocolDefaults mints the shared
credentials on the first inbound and every later one reuses them; the
applies then run concurrently, capped at inboundFanoutConcurrency. A
4-node create measured 1.205s -> 0.307s with peak overlap 1 -> 4.

Consequences of no longer aborting at the first failing inbound:

- Every apply error is tagged with its inbound and the failures are
  joined, so all of them reach the caller instead of just the first.
- The fanout goroutines recover their own panics. Off the request
  goroutine gin's Recovery no longer covers them, and an unrecovered
  panic would kill the panel rather than fail one inbound.
- A partly-applied call commits clients on the inbounds that succeeded,
  so the controller and the LDAP job now read needRestart before the
  error check; otherwise Xray was never flagged for the work that landed.
- limitHwid is applied only when every inbound succeeded. Applying it
  after a failure rewrites limit_hwid and trims the registered devices of
  an email that already existed, which is silent data loss on an
  operation the panel reported as failed.

Update the API docs for the new partial-application contract and the
inbound-tagged error strings.
2026-09-04 01:01:20 +02:00
..
amneziawg_job.go feat(amneziawg): add native AmneziaWG protocol support (#6105) 2026-08-24 02:41:15 +02:00
check_client_ip_frozen_ban_test.go fix(iplimit): ban a dead connection once instead of every scan 2026-07-11 22:48:58 +02:00
check_client_ip_job.go fix(job): expire stored client IPs of offline clients 2026-08-24 13:27:40 +02:00
check_client_ip_job_integration_test.go feat(limitip): let operators exempt trusted addresses from the IP limit (#6230) 2026-08-18 12:23:10 +02:00
check_client_ip_job_test.go fix(clients): parse only settings.clients across protocols (#5855) 2026-07-08 20:31:00 +02:00
check_client_ip_scale_test.go refactor: modernize Go with strings.SplitSeq and maps.Copy 2026-07-08 22:10:54 +02:00
check_cpu_usage.go style: adopt golangci-lint v2 and resolve all findings 2026-06-27 15:42:22 +02:00
check_hash_storage.go refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
check_hash_storage_test.go refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
check_memory_usage.go style: adopt golangci-lint v2 and resolve all findings 2026-06-27 15:42:22 +02:00
check_xray_running_job.go feat(notifications): event bus architecture with Telegram and SMTP subscribers (#5326) 2026-06-15 21:03:41 +02:00
clear_logs_job.go fix(logs): limit Xray log growth (#5840) 2026-07-08 00:33:34 +03:00
clear_logs_job_test.go fix(logs): limit Xray log growth (#5840) 2026-07-08 00:33:34 +03:00
free_os_memory.go perf(memory): report real RSS and cut footprint via GOGC + periodic release 2026-06-25 22:16:38 +02:00
ip_limit_allowlist.go chore(build): bump Go toolchain to 1.27.0 2026-08-23 21:57:03 +02:00
ip_limit_allowlist_agreement_test.go fix: follow-ups from the post-merge reviews of #6221, #6227, #6230 and #6239 (#6250) 2026-08-18 15:24:59 +02:00
ip_limit_allowlist_test.go feat(limitip): let operators exempt trusted addresses from the IP limit (#6230) 2026-08-18 12:23:10 +02:00
ldap_auto_delete_guard_test.go fix(ldap): stop auto-delete from wiping every client on an empty directory 2026-08-01 15:18:50 +02:00
ldap_sync_job.go perf(clients): apply a multi-inbound client create concurrently 2026-09-04 01:01:20 +02:00
ldap_sync_job_test.go perf(clients): apply a multi-inbound client create concurrently 2026-09-04 01:01:20 +02:00
limit_ip_disconnect_test.go fix(job): force-disconnect over-limit Hysteria2 clients 2026-08-24 13:27:40 +02:00
mtproto_job.go fix(mtproto): stop dropping connections on client/inbound edits; add live updates + ad-tag (#5838) 2026-07-07 01:13:24 +02:00
node_heartbeat_job.go fix(nodes): keep the credential-presence flag on the node heartbeat push 2026-07-28 17:38:46 +02:00
node_traffic_sync_job.go fix(node): stop stale expiry sync from undoing client extensions (#6228) (#6231) 2026-08-23 23:17:56 +02:00
node_traffic_sync_job_test.go fix(node): don't stamp InboundsAdoptedAt when the sync adopted nothing (#6284) 2026-08-22 20:37:55 +02:00
outbound_subscription_job.go refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
periodic_traffic_reset_client_test.go feat(clients): give each client its own traffic reset cycle (#6240) 2026-08-18 13:08:44 +02:00
periodic_traffic_reset_job.go feat(clients): give each client its own traffic reset cycle (#6240) 2026-08-18 13:08:44 +02:00
periodic_traffic_reset_job_test.go inbounds: allow custom monthly traffic reset days (#6071) 2026-07-28 23:27:09 +02:00
reap_sync_orphans_job.go fix(node): stop the node sync from deleting clients it never meant to 2026-08-01 15:19:08 +02:00
remote_routing_job.go Add remote routing URL support (#6168) 2026-08-18 16:02:11 +02:00
stats_notify_job.go refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
warp_ip_job.go fix(warp): surface update-clock persistence failures (#6209) 2026-08-13 12:31:05 +02:00
warp_ip_job_test.go fix(warp): surface update-clock persistence failures (#6209) 2026-08-13 12:31:05 +02:00
xray_traffic_inform_test.go style: drop the line comments added with the triage fixes 2026-07-27 14:37:57 +02:00
xray_traffic_job.go perf(clients): make the clients page scale to large panels 2026-07-30 02:49:32 +02:00
xray_traffic_job_broadcast_test.go perf(clients): make the clients page scale to large panels 2026-07-30 02:49:32 +02:00