Multi-user collision: rtc.tcp_port wildcard-binds on *:7881, hardcoded — second user fails to start #33
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
#31 / PR #32 fixed the UDP/7882 multi-user collision by adding
rtc.ips.includesso each user's livekit binds UDP only on its ownnode_ip. That works.Observed on dev box
138.201.206.39after deploying #32: the SAME multi-user collision now surfaces on TCP port 7881 (the ICE-TCP fallback). Concretely, when ashraf's livekit-server tries to start while sameh's is already running:Why
The yaml renderer in
crates/hero_livekit_server/src/livekit/rpc.rs:899hardcodes:Combined with
bind_addresses: "0.0.0.0"(kept that way because the wrapper's own twirp client atrpc.rs:385calls livekit-server viahttp://127.0.0.1:<livekit_port>— see the comment at line 891), this means:ss -lntpon the dev box shows the collision concretely:A second instance (any user) trying to bind
*:7881getsEADDRINUSE— even though theirnode_ipis unique.Fix
Make
rtc.tcp_portconfigurable fromruntime.json, mirroring howlivekit_portandbackend_portalready work. Multi-user setups allocate per-user TCP ports (e.g., sameh: 7881, ashraf: 7981, ...) so the wildcard*:tcp_portlisteners no longer collide.UDP doesn't need a similar treatment in this issue's scope:
rtc.ips.includesalready makes UDP per-user-IP-exclusive, so keepingudp_port: 7882shared is fine.Verification (after PR)
With the fix applied and ashraf's
runtime.jsonset to"rtc_tcp_port": 7981:Both livekit-servers running concurrently.
Follow-up needed in hero_skills
This change makes the field configurable, but
multi_user_addstill needs to allocate non-overlapping per-user TCP ports when creating a user (and write them intoruntime.json). I'll file that as a separate hero_skills issue so this PR stays scoped to hero_livekit.