You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unstable UDP listener does not provide reusePort/SO_REUSEPORT option, all traffic on one thread #36858
As described. The Deno.listenDatagram API does not provide the SO_REUSEPORT socket option.
Looking through some other issues and code comments shows that it isn't available due to cross-platform compatibility. I think it would be convenient to have this available, at least on Linux. I'm not so sure about how Deno handles I/OCP on Windows, though it would also be a nice-to-have. Deno.TcpListenOptions already implements reusePort.
constworkerId=crypto.randomUUID();constlistener=Deno.listenDatagram({transport: "udp",port: 3000,hostname: "127.0.0.1",reusePort: true});// across several worker threadsconstcb=(d: Uint8Array<ArrayBufferLike>,a: Deno.Addr)=>{console.log(`(${workerId}) ${d.byteLength} from ${a.hostname}:${a.port}`);}constloop=()=>{listener.receive().then(([d,a])=>cb(d,a)).finally(loop);};loop();
changed the title [-]Unstable UDP listener does not provide `reusePort`/`SO_REUSEPORT` option[/-][+]Unstable UDP listener does not provide `reusePort`/`SO_REUSEPORT` option, all traffic on one thread[/+]on Sep 17, 2026
I can investigate the missing reusePort / SO_REUSEPORT option for unstable UDP listeners. I will reproduce the current listener behavior, trace the platform-specific socket setup, and add focused regression coverage with the smallest compatible change if confirmed. I will report the validation results in the PR.
Update: I was able to compile with set_reuse_port set without set_reuse_addr in net_listen_udp and it seems to work. It now seems like set_reuse_addr is causing the thread exclusivity.
Activity
[-]Unstable UDP listener does not provide `reusePort`/`SO_REUSEPORT` option[/-][+]Unstable UDP listener does not provide `reusePort`/`SO_REUSEPORT` option, all traffic on one thread[/+]ZombieB1309 commentedon Sep 17, 2026
Looking at the source more closely.
set_reuse_portis set explicitly but I'm seeing all traffic go to one thread.Tiancheng-Xu commentedon Sep 17, 2026
I can investigate the missing
reusePort/SO_REUSEPORToption for unstable UDP listeners. I will reproduce the current listener behavior, trace the platform-specific socket setup, and add focused regression coverage with the smallest compatible change if confirmed. I will report the validation results in the PR.ZombieB1309 commentedon Sep 18, 2026
Update: I was able to compile with
set_reuse_portset withoutset_reuse_addrinnet_listen_udpand it seems to work. It now seems likeset_reuse_addris causing the thread exclusivity.