3x-ui/internal/web
MHSanaei c5d31de4e9 fix(service): serialize client/inbound writes to prevent Postgres deadlock
Client/inbound mutations opened their own transactions that locked
client_traffics before inbounds, while the @every 5s traffic poll
(AddTraffic, already serialized through the traffic writer) locks them in
the opposite order. Concurrently these formed an ABBA lock cycle that
Postgres aborted as "deadlock detected" (SQLSTATE 40P01), failing client
updates.

Route those DB writes through the same single-goroutine traffic writer via
a new runSerializedTx helper, so they can never run concurrently with the
poll. For the client-edit paths the runtime (node) push is moved after the
commit, keeping network I/O out of the serialized section. UpdateInbound
keeps its push inside the transaction because EnsureInboundTagAllowed must
reach the node before the central row is committed.

Covers UpdateInboundClient/addInboundClient/DelInboundClientByEmail/
delInboundClients, the bulk adjust/delete transactions, and UpdateInbound.
2026-06-17 15:55:47 +02:00
..
controller feat(hosts): managed Hosts for per-host subscription link overrides (#5409) 2026-06-17 12:06:55 +02:00
entity feat(hosts): managed Hosts for per-host subscription link overrides (#5409) 2026-06-17 12:06:55 +02:00
global
job feat(nodes): per-node client IP attribution for IP-limit 2026-06-15 23:50:05 +02:00
locale
middleware feat(node): node hardening — mTLS, hashed+zstd reconcile transport, per-node net metrics (#5382) 2026-06-16 12:19:33 +02:00
network
runtime feat(node): node hardening — mTLS, hashed+zstd reconcile transport, per-node net metrics (#5382) 2026-06-16 12:19:33 +02:00
service fix(service): serialize client/inbound writes to prevent Postgres deadlock 2026-06-17 15:55:47 +02:00
session
translation i18n: sync 12 locales with en-US — add missing Hosts/subscription keys 2026-06-17 12:19:05 +02:00
websocket
cadence_test.go refactor(web): centralize background job cadences (#5269) 2026-06-14 22:50:24 +02:00
web.go feat(node): node hardening — mTLS, hashed+zstd reconcile transport, per-node net metrics (#5382) 2026-06-16 12:19:33 +02:00
web_mtls.go feat(node): node hardening — mTLS, hashed+zstd reconcile transport, per-node net metrics (#5382) 2026-06-16 12:19:33 +02:00
web_mtls_test.go feat(node): node hardening — mTLS, hashed+zstd reconcile transport, per-node net metrics (#5382) 2026-06-16 12:19:33 +02:00