Files
Nick Beirne 254cb9a426 wgengine/magicsock: retry all UDP read errors with a delay
tailscale/wireguard-go#116 changed the receive loop to retry any errors
other than net.ErrClosed without a delay. magicsock entered a spin loop
if it encountered a UDP read error.

magicsock's receive funcs now return only net.ErrClosed when the socket
actually closes. Every other read error is counted, logged, and retried
after a short delay. IsUDPReadFeedback and IsUDPReadUnknown are removed
because they can be handled like any other error.

Retrying errors may hide failures which used to stop the receive func.
- There is a new metric magicsock_recv_udp_error which counts all read
  errors.
- After 30s of continuous errors, the receive function marks itself as
  broken. A warning is raised until a read succeeds.

Updates #22097

Change-Id: Ib9ade0ed001e413205eb7d452aa108aae574e0d1
Signed-off-by: Nick Beirne <[email protected]>
2026-11-12 15:46:56 -05:00
..
2026-07-10 17:39:16 -07:00
2026-11-12 10:15:41 +01:00