Hello,

This series adds normal UDP-to-TCP fallback to HAProxy's DNS resolver.
It follows the design RFC posted here:

  https://www.mail-archive.com/[email protected]/msg47368.html

An unprefixed IPv4, IPv6, or hostname nameserver now uses UDP first and
retries a validated truncated response over TCP against the same address
and port. Nameservers imported from resolv.conf use the same default.
Explicit udp@, udp4@, udp6@, and dgram+ addresses remain UDP-only, while
tcp@ remains TCP-only.

TCP connections are established lazily and reuse the existing DNS stream
connection pooling, pipelining, timeouts, and idle cleanup. Starting TCP
fallback preserves the query ID and type and does not consume a resolver
retry or trigger A/AAAA fallback. The accepted_payload_size setting
remains the EDNS advertisement and UDP receive limit; TCP responses are
accepted up to the DNS protocol maximum. Explicit UDP-only nameservers
retain the existing handling of truncated SRV responses.

The first two patches correct response-boundary parsing and stream
idle-task scheduling. The cleanup then allows one logical nameserver to
release both transports. The fourth patch implements the fallback
behavior, configuration semantics, documentation, and tcp_fallback
counter. The final patch adds the regression coverage.

Thanks,
Manu

Manu Nicolas (5):
  BUG/MINOR: resolvers: accept fields at the response boundary
  BUG/MINOR: dns: schedule idle task after setting its thread
  CLEANUP: dns: centralize nameserver transport cleanup
  MEDIUM: resolvers: retry truncated UDP responses over TCP
  REGTEST: resolvers: cover UDP to TCP fallback

 addons/promex/README                 |   1 +
 doc/configuration.txt                |  34 ++-
 include/haproxy/dns-t.h              |  12 +-
 include/haproxy/dns.h                |   5 +-
 include/haproxy/resolvers-t.h        |   3 +-
 reg-tests/contrib/prometheus.vtc     |   1 +
 reg-tests/resolvers/tcp_fallback.py  | 152 +++++++++++++
 reg-tests/resolvers/tcp_fallback.vtc | 136 ++++++++++++
 src/dns.c                            |  45 ++--
 src/resolvers.c                      | 313 +++++++++++++++++++--------
 10 files changed, 583 insertions(+), 119 deletions(-)
 create mode 100644 reg-tests/resolvers/tcp_fallback.py
 create mode 100644 reg-tests/resolvers/tcp_fallback.vtc


base-commit: ff88d845a2646b6e34cccce12ff8e9fc80033795
-- 
2.54.0

Reply via email to