Tokio bug: concurrent UDP sends can hang forever on OpenBSD, with a workaround

jedisct1 · x · 2026-10-14

jedisct1 filed a Tokio issue (#8643) showing that concurrent UdpSocket::sendto calls on the same socket can stop making progress indefinitely on OpenBSD 7.9 (Tokio 1.53.3, Mio 1.2.4).

A reproducer with eight tasks sharing one socket reliably hits a 60-second timeout; serializing sends fixes it (80,000 sends in 5.5s). The likely cause: OpenBSD returns EWOULDBLOCK when concurrent sends contend for the socket's send lock, after which Tokio clears writable readiness and waits for an event that never arrives. A per-socket async send mutex is a reliable workaround; the author suggests Tokio serialize sends per UDP socket on OpenBSD.

Original post →

More from Infra

Infra channel →