WebRTC from a Sandbox to an outside peer almost never connects (1 success in ~16 attempts in production, 1 in 4 with aiortc) when the Sandbox lands in MODAL_REGION=seattle (Cirrascale, egress 64.70.114.0/24), CHI (Latitude.sh, 152.236.x.x) or new-york (149.51.48.x) — all CLOUD_PROVIDER_UNSPECIFIED. Same code works every time on OCI and Azure. Turns out it has nothing to do with WebRTC — it's how UDP is handled at those sites.
min_repro.py (attached, only needs pip install modal):
- Start a Sandbox, bind a UDP socket in it, learn its public
ip:portwith one STUN request tostun.l.google.com. - From an outside machine, send a few UDP packets to that
ip:portbefore the Sandbox has sent anything to the outside machine.
