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
#19454 added software support for QUIC during hot restart. #34731 is open for doing that with eBPF.
I believe for UDP it is not possible to use eBPF because there is no dynamic lookup table (though possibly one could generate and install a rule when hot restart begins, using a lookup table of the connections that exist at that time, and remove that rule when the parent instance terminates).
Apparently during hot restart the current behavior is UDP listeners almost entirely cease to function.
A software UDP implementation could theoretically mirror what was done for QUIC; a lookup table of address tuples (source IP, source port, destination IP, destination port) on the parent instance, each incoming packet checked against that table, delivered as usual if present, or forwarded to the child instance if not present.
Steps to this:
child instance should not listen for UDP until the parent instance stops listening (this step alone would at least fix "not functioning at all during hot restart")
parent instance would need to keep track of active "connections" in order to populate such a lookup table
parent instance would need to, during hot restart, check every packet against that table and forward if necessary
child instance would need to receive forwarded packets and deliver them as if they were not forwarded
The child's listener starts reading only after HotRestartingChild::allDrainsImplicitlyComplete, i.e. at parent terminate, so between drain start and --parent-shutdown-time-s nobody reads the socket at all.
Not closing the sockets for connectionless UDP listeners and not calling the shutdownListener cleanup during hotrestart removes the gap during which no UDP packets are read, which causes both "established" and new UDP flows to go to the old epoch. Routing new flows to the new instance via the hot restart RPC is then just a matter of installing the Network::NonDispatchedUdpPacketHandler and maintaining a map of established flows with a timeout after which an entry is removed.
Sounds good to me. Not sure how (if at all) udp packets interact with bpf - if they do it might make this slightly more complicated. Can't really make it worse though!
UDP packets don't interact with BPF here, raw UDP listeners have no BPF program attached.
Default reuseport kernel behaviour picks the socket by 4tuple hash index into the reuseport group (QUIC can't use that since clients can migrate IPs, hence the cBPF program which routes based on CID overriding it). Hot restart / LDS duplicates the parent's sockets, so the reuseport group stays the same.
We could skip the RPC with an eBPF program explicitly mapping 4tuple->socket, and having the new instance create new sockets instead of duplicating, but thats out of scope for now.
Activity
filipcacky commentedon Jul 31, 2026
I took a look at this since I was already in the neighbourhood working on QUIC eBPF.
The parent's listener stops reading from the socket due to ListenerManagerImpl::maybeCloseSocketsForListener as well as ActiveRawUdpListener::shutdownListener.
The child's listener starts reading only after HotRestartingChild::allDrainsImplicitlyComplete, i.e. at parent terminate, so between drain start and --parent-shutdown-time-s nobody reads the socket at all.
Not closing the sockets for connectionless UDP listeners and not calling the
shutdownListenercleanup during hotrestart removes the gap during which no UDP packets are read, which causes both "established" and new UDP flows to go to the old epoch. Routing new flows to the new instance via the hot restart RPC is then just a matter of installing theNetwork::NonDispatchedUdpPacketHandlerand maintaining a map of established flows with a timeout after which an entry is removed.I'd be happy to turn this into a PR.
ravenblackx commentedon Jul 31, 2026
Sounds good to me. Not sure how (if at all) udp packets interact with bpf - if they do it might make this slightly more complicated. Can't really make it worse though!
filipcacky commentedon Jul 31, 2026
UDP packets don't interact with BPF here, raw UDP listeners have no BPF program attached.
Default reuseport kernel behaviour picks the socket by 4tuple hash index into the reuseport group (QUIC can't use that since clients can migrate IPs, hence the cBPF program which routes based on CID overriding it). Hot restart / LDS duplicates the parent's sockets, so the reuseport group stays the same.
We could skip the RPC with an eBPF program explicitly mapping 4tuple->socket, and having the new instance create new sockets instead of duplicating, but thats out of scope for now.
Support hot restart handoff for connectionless UDP flows (#46502)