Company
Date Published
Author
Marek Majkowski
Word count
2806
Language
English
Hacker News points
None

Summary

The Cloudflare team has developed a solution to handle graceful restarts for UDP servers, a challenging problem that arises with the increasing adoption of UDP-based protocols like QUIC. The solution, called udpgrm, is a lightweight daemon that helps upgrade UDP servers without dropping a single packet. It uses Linux's SO_REUSEPORT API and eBPF programs to route packets to the correct instance and preserve flow stickiness. The daemon is designed to be easy to use, yet hides complexity and solves a hard problem. It supports three dissector modes: DISSECTOR_FLOW, DISSECTOR_CBPF, and DISSECTOR_NOOP, which can be used for different protocols and server requirements. udpgrm provides a clean API using setsockopt() calls, careful socket-stealing logic, powerful and expressive configurable dissectors, and well-thought-out integration with systemd. The solution is intended to create space and vocabulary for long-term improvements in the Linux Sockets API.